Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / search / engineextension / PhabricatorHovercardEngineExtension.php
blob060441c98503e0a56fdc15b49dfe2b0a08d522fd
1 <?php
3 abstract class PhabricatorHovercardEngineExtension extends Phobject {
5 private $viewer;
7 final public function getExtensionKey() {
8 return $this->getPhobjectClassConstant('EXTENSIONKEY');
11 final public function setViewer($viewer) {
12 $this->viewer = $viewer;
13 return $this;
16 final public function getViewer() {
17 return $this->viewer;
20 abstract public function isExtensionEnabled();
22 abstract public function getExtensionName();
24 abstract public function canRenderObjectHovercard($object);
26 public function getExtensionOrder() {
27 return 5000;
30 public function willRenderHovercards(array $objects) {
31 return null;
34 abstract public function renderHovercard(
35 PHUIHovercardView $hovercard,
36 PhabricatorObjectHandle $handle,
37 $object,
38 $data);
40 final public static function getAllExtensions() {
41 return id(new PhutilClassMapQuery())
42 ->setAncestorClass(__CLASS__)
43 ->setUniqueMethod('getExtensionKey')
44 ->setSortMethod('getExtensionOrder')
45 ->execute();
48 final public static function getAllEnabledExtensions() {
49 $extensions = self::getAllExtensions();
51 foreach ($extensions as $key => $extension) {
52 if (!$extension->isExtensionEnabled()) {
53 unset($extensions[$key]);
57 return $extensions;