Changeset View
Changeset View
Standalone View
Standalone View
src/applications/flag/query/PhabricatorFlagSearchEngine.php
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | final class PhabricatorFlagSearchEngine | ||||
private function getGroupOptions() { | private function getGroupOptions() { | ||||
return array( | return array( | ||||
PhabricatorFlagQuery::GROUP_NONE => pht('None'), | PhabricatorFlagQuery::GROUP_NONE => pht('None'), | ||||
PhabricatorFlagQuery::GROUP_COLOR => pht('Color'), | PhabricatorFlagQuery::GROUP_COLOR => pht('Color'), | ||||
); | ); | ||||
} | } | ||||
private function getObjectFilterOptions() { | private function getObjectFilterOptions() { | ||||
$objects = id(new PhutilSymbolLoader()) | $objects = id(new PhutilClassMapQuery()) | ||||
->setAncestorClass('PhabricatorFlaggableInterface') | ->setAncestorClass('PhabricatorFlaggableInterface') | ||||
->loadObjects(); | ->execute(); | ||||
$all_types = PhabricatorPHIDType::getAllTypes(); | $all_types = PhabricatorPHIDType::getAllTypes(); | ||||
$options = array(); | $options = array(); | ||||
foreach ($objects as $object) { | foreach ($objects as $object) { | ||||
$phid = $object->generatePHID(); | $phid = $object->generatePHID(); | ||||
$phid_type = phid_get_type($phid); | $phid_type = phid_get_type($phid); | ||||
$type_object = idx($all_types, $phid_type); | $type_object = idx($all_types, $phid_type); | ||||
if ($type_object) { | if ($type_object) { | ||||
$options[$phid_type] = $type_object->getTypeName(); | $options[$phid_type] = $type_object->getTypeName(); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |