Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phid/handle/pool/PhabricatorHandleList.php
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | public function getHandleIfExists($phid, $default = null) { | ||||
if ($this->handles === null) { | if ($this->handles === null) { | ||||
$this->loadHandles(); | $this->loadHandles(); | ||||
} | } | ||||
return idx($this->handles, $phid, $default); | return idx($this->handles, $phid, $default); | ||||
} | } | ||||
/** | |||||
* Create a new list with a subset of the PHIDs in this list. | |||||
*/ | |||||
public function newSublist(array $phids) { | |||||
foreach ($phids as $phid) { | |||||
if (!isset($this[$phid])) { | |||||
throw new Exception( | |||||
pht( | |||||
'Trying to create a new sublist of an existsing handle list, '. | |||||
'but PHID "%s" does not appear in the parent list.', | |||||
$phid)); | |||||
} | |||||
} | |||||
return $this->handlePool->newHandleList($phids); | |||||
} | |||||
/* -( Rendering )---------------------------------------------------------- */ | /* -( Rendering )---------------------------------------------------------- */ | ||||
/** | /** | ||||
* Return a @{class:PHUIHandleListView} which can render the handles in | * Return a @{class:PHUIHandleListView} which can render the handles in | ||||
* this list. | * this list. | ||||
*/ | */ | ||||
public function renderList() { | public function renderList() { | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |