3 final class PhabricatorProjectsSearchEngineExtension
4 extends PhabricatorSearchEngineExtension
{
6 const EXTENSIONKEY
= 'projects';
8 public function isExtensionEnabled() {
9 return PhabricatorApplication
::isClassInstalled(
10 'PhabricatorProjectApplication');
13 public function getExtensionName() {
14 return pht('Support for Projects');
17 public function getExtensionOrder() {
21 public function supportsObject($object) {
22 return ($object instanceof PhabricatorProjectInterface
);
25 public function applyConstraintsToQuery(
28 PhabricatorSavedQuery
$saved,
31 if (!empty($map['projectPHIDs'])) {
32 $query->withEdgeLogicConstraints(
33 PhabricatorProjectObjectHasProjectEdgeType
::EDGECONST
,
34 $map['projectPHIDs']);
38 public function getSearchFields($object) {
41 $fields[] = id(new PhabricatorProjectSearchField())
42 ->setKey('projectPHIDs')
43 ->setConduitKey('projects')
44 ->setAliases(array('project', 'projects', 'tag', 'tags'))
45 ->setLabel(pht('Tags'))
47 pht('Search for objects tagged with given projects.'));
52 public function getSearchAttachments($object) {
54 id(new PhabricatorProjectsSearchEngineAttachment())
55 ->setAttachmentKey('projects'),