Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / search / engineextension / PhabricatorSearchEngineExtension.php
blobf93c09cf8f8e4944ec6149fbabb4eedc3bdb7fdd
1 <?php
3 abstract class PhabricatorSearchEngineExtension extends Phobject {
5 private $viewer;
6 private $searchEngine;
8 final public function getExtensionKey() {
9 return $this->getPhobjectClassConstant('EXTENSIONKEY');
12 final public function setViewer($viewer) {
13 $this->viewer = $viewer;
14 return $this;
17 final public function getViewer() {
18 return $this->viewer;
21 final public function setSearchEngine(
22 PhabricatorApplicationSearchEngine $engine) {
23 $this->searchEngine = $engine;
24 return $this;
27 final public function getSearchEngine() {
28 return $this->searchEngine;
31 abstract public function isExtensionEnabled();
32 abstract public function getExtensionName();
33 abstract public function supportsObject($object);
35 public function getExtensionOrder() {
36 return 7000;
39 public function getSearchFields($object) {
40 return array();
43 public function getSearchAttachments($object) {
44 return array();
47 public function applyConstraintsToQuery(
48 $object,
49 $query,
50 PhabricatorSavedQuery $saved,
51 array $map) {
52 return;
55 public function getFieldSpecificationsForConduit($object) {
56 return array();
59 public function loadExtensionConduitData(array $objects) {
60 return null;
63 public function getFieldValuesForConduit($object, $data) {
64 return array();
67 final public static function getAllExtensions() {
68 return id(new PhutilClassMapQuery())
69 ->setAncestorClass(__CLASS__)
70 ->setUniqueMethod('getExtensionKey')
71 ->setSortMethod('getExtensionOrder')
72 ->execute();
75 final public static function getAllEnabledExtensions() {
76 $extensions = self::getAllExtensions();
78 foreach ($extensions as $key => $extension) {
79 if (!$extension->isExtensionEnabled()) {
80 unset($extensions[$key]);
84 return $extensions;