Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/phid/PhabricatorPhamePHIDTypePost.php
Show All 13 Lines | final class PhabricatorPhamePHIDTypePost extends PhabricatorPHIDType { | ||||
public function getTypeName() { | public function getTypeName() { | ||||
return pht('Phame Post'); | return pht('Phame Post'); | ||||
} | } | ||||
public function newObject() { | public function newObject() { | ||||
return new PhamePost(); | return new PhamePost(); | ||||
} | } | ||||
public function loadObjects( | protected function buildQueryForObjects( | ||||
PhabricatorObjectQuery $query, | PhabricatorObjectQuery $query, | ||||
array $phids) { | array $phids) { | ||||
return id(new PhamePostQuery()) | return id(new PhamePostQuery()) | ||||
->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) { | ||||
$post = $objects[$phid]; | $post = $objects[$phid]; | ||||
$handle->setName($post->getTitle()); | $handle->setName($post->getTitle()); | ||||
$handle->setFullName($post->getTitle()); | $handle->setFullName($post->getTitle()); | ||||
$handle->setURI('/phame/post/view/'.$post->getID().'/'); | $handle->setURI('/phame/post/view/'.$post->getID().'/'); | ||||
} | } | ||||
} | } | ||||
} | } |