Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13976653
D12581.id30208.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12581.id30208.diff
View Options
diff --git a/src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php b/src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php
--- a/src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php
+++ b/src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php
@@ -38,4 +38,32 @@
}
}
+ public function canLoadNamedObject($name) {
+ return preg_match('/^E[1-9]\d*$/i', $name);
+ }
+
+ public function loadNamedObjects(
+ PhabricatorObjectQuery $query,
+ array $names) {
+
+ $id_map = array();
+ foreach ($names as $name) {
+ $id = (int)substr($name, 1);
+ $id_map[$id][] = $name;
+ }
+
+ $objects = id(new PhabricatorCalendarEventQuery())
+ ->setViewer($query->getViewer())
+ ->withIDs(array_keys($id_map))
+ ->execute();
+
+ $results = array();
+ foreach ($objects as $id => $object) {
+ foreach (idx($id_map, $id, array()) as $name) {
+ $results[$name] = $object;
+ }
+ }
+
+ return $results;
+ }
}
diff --git a/src/applications/differential/phid/DifferentialRevisionPHIDType.php b/src/applications/differential/phid/DifferentialRevisionPHIDType.php
--- a/src/applications/differential/phid/DifferentialRevisionPHIDType.php
+++ b/src/applications/differential/phid/DifferentialRevisionPHIDType.php
@@ -47,7 +47,7 @@
}
public function canLoadNamedObject($name) {
- return preg_match('/^D\d*[1-9]\d*$/i', $name);
+ return preg_match('/^D[1-9]\d*$/i', $name);
}
public function loadNamedObjects(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 19 2024, 3:12 PM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6732727
Default Alt Text
D12581.id30208.diff (1 KB)
Attached To
Mode
D12581: Calendar event monograms, part 4. Typing E{id} makes the object available in global search.
Attached
Detach File
Event Timeline
Log In to Comment