Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14006372
D12581.id30206.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.id30206.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\d*[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;
+ }
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 29, 7:49 AM (3 w, 1 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6751679
Default Alt Text
D12581.id30206.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