4 * Resolve a list of identifiers into PHIDs.
6 * This class simplifies the process of converting a list of mixed token types
7 * (like some PHIDs and some usernames) into a list of just PHIDs.
9 abstract class PhabricatorPHIDResolver
extends Phobject
{
13 final public function setViewer(PhabricatorUser
$viewer) {
14 $this->viewer
= $viewer;
18 final public function getViewer() {
22 final public function resolvePHIDs(array $phids) {
23 $type_unknown = PhabricatorPHIDConstants
::PHID_TYPE_UNKNOWN
;
26 foreach ($phids as $key => $phid) {
27 if (phid_get_type($phid) == $type_unknown) {
33 $map = $this->getResolutionMap($names);
34 foreach ($names as $key => $name) {
35 if (isset($map[$name])) {
36 $phids[$key] = $map[$name];
44 abstract protected function getResolutionMap(array $names);