Differential D17004 Diff 41390 src/applications/search/engine/PhabricatorApplicationSearchEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Represents an abstract search engine for an application. It supports | * Represents an abstract search engine for an application. It supports | ||||
| * creating and storing saved queries. | * creating and storing saved queries. | ||||
| * | * | ||||
| * @task construct Constructing Engines | * @task construct Constructing Engines | ||||
| * @task app Applications | * @task app Applications | ||||
| * @task builtin Builtin Queries | * @task builtin Builtin Queries | ||||
| * @task uri Query URIs | * @task uri Query URIs | ||||
| * @task dates Date Filters | * @task dates Date Filters | ||||
| * @task order Result Ordering | * @task order Result Ordering | ||||
| * @task read Reading Utilities | * @task read Reading Utilities | ||||
| * @task exec Paging and Executing Queries | * @task exec Paging and Executing Queries | ||||
| * @task render Rendering Results | * @task render Rendering Results | ||||
| * @task custom Custom Fields | |||||
| */ | */ | ||||
| abstract class PhabricatorApplicationSearchEngine extends Phobject { | abstract class PhabricatorApplicationSearchEngine extends Phobject { | ||||
| private $application; | private $application; | ||||
| private $viewer; | private $viewer; | ||||
| private $errors = array(); | private $errors = array(); | ||||
| private $request; | private $request; | ||||
| private $context; | private $context; | ||||
| ▲ Show 20 Lines • Show All 1,371 Lines • ▼ Show 20 Lines | /* -( Application Search )------------------------------------------------- */ | ||||
| protected function getNewUserBody() { | protected function getNewUserBody() { | ||||
| return null; | return null; | ||||
| } | } | ||||
| public function newUseResultsActions(PhabricatorSavedQuery $saved) { | public function newUseResultsActions(PhabricatorSavedQuery $saved) { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| /** | |||||
| * @return map<phid->PhabricatorCustomFieldList> of loaded fields. | |||||
| * @task custom | |||||
| */ | |||||
| protected function loadCustomFields(array $objects, $role) { | |||||
| assert_instances_of($objects, 'PhabricatorCustomFieldInterface'); | |||||
| $custom_fields_query = new PhabricatorCustomFieldStorageQuery(); | |||||
| $custom_field_lists = array(); | |||||
| foreach ($objects as $object) { | |||||
| $field_list = PhabricatorCustomField::getObjectFields($object, $role); | |||||
| $field_list->readFieldsFromObject($object); | |||||
| $custom_field_lists[$object->getPHID()] = $field_list; | |||||
| $custom_fields_query->addFields($field_list->getFields()); | |||||
| } | |||||
| // This update the field_list objects. | |||||
| $custom_fields_query->execute(); | |||||
| return $custom_field_lists; | |||||
| } | |||||
| } | } | ||||