Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14087043
D16376.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1011 B
Referenced Files
None
Subscribers
None
D16376.diff
View Options
diff --git a/src/applications/differential/phid/DifferentialDiffPHIDType.php b/src/applications/differential/phid/DifferentialDiffPHIDType.php
--- a/src/applications/differential/phid/DifferentialDiffPHIDType.php
+++ b/src/applications/differential/phid/DifferentialDiffPHIDType.php
@@ -39,4 +39,33 @@
}
}
+ public function canLoadNamedObject($name) {
+ return preg_match('/^Diff [1-9]\d*$/i', $name);
+ }
+
+ public function loadNamedObjects(
+ PhabricatorObjectQuery $query,
+ array $names) {
+
+ $id_map = array();
+ foreach ($names as $name) {
+ $id = (int)substr($name, 5);
+ $id_map[$id][] = $name;
+ }
+
+ $objects = id(new DifferentialDiffQuery())
+ ->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
Sun, Nov 24, 6:41 PM (20 h, 33 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6783689
Default Alt Text
D16376.diff (1011 B)
Attached To
Mode
D16376: Add support for Differential Diffs to phid.lookup / PhabricatorObjectQuery
Attached
Detach File
Event Timeline
Log In to Comment