Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/phid/PhabricatorCalendarEventPHIDType.php
Show All 32 Lines | foreach ($handles as $phid => $handle) { | ||||
$handle | $handle | ||||
->setName(pht('Event %d', $id)) | ->setName(pht('Event %d', $id)) | ||||
->setFullName(pht('E%d: %s', $id, $name)) | ->setFullName(pht('E%d: %s', $id, $name)) | ||||
->setURI('/E'.$id); | ->setURI('/E'.$id); | ||||
} | } | ||||
} | } | ||||
public function canLoadNamedObject($name) { | |||||
return preg_match('/^E[1-9]\d*$/i', $name); | |||||
epriestley: I think that has an extra `\d*` in it, it should just be like this I think:
```lang=diff… | |||||
} | |||||
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; | |||||
} | |||||
} | } |
I think that has an extra \d* in it, it should just be like this I think:
If that was a copy/paste, the source is probably messed up too.