3 abstract class PhabricatorSearchEngineExtension
extends Phobject
{
8 final public function getExtensionKey() {
9 return $this->getPhobjectClassConstant('EXTENSIONKEY');
12 final public function setViewer($viewer) {
13 $this->viewer
= $viewer;
17 final public function getViewer() {
21 final public function setSearchEngine(
22 PhabricatorApplicationSearchEngine
$engine) {
23 $this->searchEngine
= $engine;
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() {
39 public function getSearchFields($object) {
43 public function getSearchAttachments($object) {
47 public function applyConstraintsToQuery(
50 PhabricatorSavedQuery
$saved,
55 public function getFieldSpecificationsForConduit($object) {
59 public function loadExtensionConduitData(array $objects) {
63 public function getFieldValuesForConduit($object, $data) {
67 final public static function getAllExtensions() {
68 return id(new PhutilClassMapQuery())
69 ->setAncestorClass(__CLASS__
)
70 ->setUniqueMethod('getExtensionKey')
71 ->setSortMethod('getExtensionOrder')
75 final public static function getAllEnabledExtensions() {
76 $extensions = self
::getAllExtensions();
78 foreach ($extensions as $key => $extension) {
79 if (!$extension->isExtensionEnabled()) {
80 unset($extensions[$key]);