Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96143689
PhabricatorProjectsSearchEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Dec 23, 02:06
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 02:06 (1 d, 19 h)
Engine
blob
Format
Raw Data
Handle
23130989
Attached To
rPH Phabricator
PhabricatorProjectsSearchEngineExtension.php
View Options
<?php
final
class
PhabricatorProjectsSearchEngineExtension
extends
PhabricatorSearchEngineExtension
{
const
EXTENSIONKEY
=
'projects'
;
public
function
isExtensionEnabled
()
{
return
PhabricatorApplication
::
isClassInstalled
(
'PhabricatorProjectApplication'
);
}
public
function
getExtensionName
()
{
return
pht
(
'Support for Projects'
);
}
public
function
getExtensionOrder
()
{
return
3000
;
}
public
function
supportsObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorProjectInterface
);
}
public
function
applyConstraintsToQuery
(
$object
,
$query
,
PhabricatorSavedQuery
$saved
,
array
$map
)
{
if
(!
empty
(
$map
[
'projectPHIDs'
]))
{
$query
->
withEdgeLogicConstraints
(
PhabricatorProjectObjectHasProjectEdgeType
::
EDGECONST
,
$map
[
'projectPHIDs'
]);
}
}
public
function
getSearchFields
(
$object
)
{
$fields
=
array
();
$fields
[]
=
id
(
new
PhabricatorProjectSearchField
())
->
setKey
(
'projectPHIDs'
)
->
setConduitKey
(
'projects'
)
->
setAliases
(
array
(
'project'
,
'projects'
,
'tag'
,
'tags'
))
->
setLabel
(
pht
(
'Tags'
))
->
setDescription
(
pht
(
'Search for objects tagged with given projects.'
));
return
$fields
;
}
public
function
getSearchAttachments
(
$object
)
{
return
array
(
id
(
new
PhabricatorProjectsSearchEngineAttachment
())
->
setAttachmentKey
(
'projects'
),
);
}
}
Event Timeline
Log In to Comment