Page MenuHomePhabricator

D16376.diff
No OneTemporary

D16376.diff

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

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)

Event Timeline