Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/phid/DivinerPHIDTypeAtom.php
Show All 10 Lines | final class DivinerPHIDTypeAtom extends PhabricatorPHIDType { | ||||
public function getTypeName() { | public function getTypeName() { | ||||
return pht('Atom'); | return pht('Atom'); | ||||
} | } | ||||
public function newObject() { | public function newObject() { | ||||
return new DivinerLiveSymbol(); | return new DivinerLiveSymbol(); | ||||
} | } | ||||
public function loadObjects( | protected function buildQueryForObjects( | ||||
PhabricatorObjectQuery $query, | PhabricatorObjectQuery $query, | ||||
array $phids) { | array $phids) { | ||||
return id(new DivinerAtomQuery()) | return id(new DivinerAtomQuery()) | ||||
->setViewer($query->getViewer()) | ->withPHIDs($phids); | ||||
->setParentQuery($query) | |||||
->withPHIDs($phids) | |||||
->execute(); | |||||
} | } | ||||
public function loadHandles( | public function loadHandles( | ||||
PhabricatorHandleQuery $query, | PhabricatorHandleQuery $query, | ||||
array $handles, | array $handles, | ||||
array $objects) { | array $objects) { | ||||
foreach ($handles as $phid => $handle) { | foreach ($handles as $phid => $handle) { | ||||
$atom = $objects[$phid]; | $atom = $objects[$phid]; | ||||
$handle->setName($atom->getTitle()); | $handle->setName($atom->getTitle()); | ||||
$handle->setURI($atom->getName()); | $handle->setURI($atom->getName()); | ||||
} | } | ||||
} | } | ||||
} | } |