Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98052214
PhabricatorSubscriptionsSearchEngineExtension.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
Thu, Jan 9, 02:39
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Jan 11, 02:39 (2 d)
Engine
blob
Format
Raw Data
Handle
23503458
Attached To
rPH Phabricator
PhabricatorSubscriptionsSearchEngineExtension.php
View Options
<?php
final
class
PhabricatorSubscriptionsSearchEngineExtension
extends
PhabricatorSearchEngineExtension
{
const
EXTENSIONKEY
=
'subscriptions'
;
public
function
isExtensionEnabled
()
{
return
PhabricatorApplication
::
isClassInstalled
(
'PhabricatorSubscriptionsApplication'
);
}
public
function
getExtensionName
()
{
return
pht
(
'Support for Subscriptions'
);
}
public
function
getExtensionOrder
()
{
return
2000
;
}
public
function
supportsObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorSubscribableInterface
);
}
public
function
applyConstraintsToQuery
(
$object
,
$query
,
PhabricatorSavedQuery
$saved
,
array
$map
)
{
if
(!
empty
(
$map
[
'subscriberPHIDs'
]))
{
$query
->
withEdgeLogicPHIDs
(
PhabricatorObjectHasSubscriberEdgeType
::
EDGECONST
,
PhabricatorQueryConstraint
::
OPERATOR_OR
,
$map
[
'subscriberPHIDs'
]);
}
}
public
function
getSearchFields
(
$object
)
{
$fields
=
array
();
$fields
[]
=
id
(
new
PhabricatorSearchSubscribersField
())
->
setLabel
(
pht
(
'Subscribers'
))
->
setKey
(
'subscriberPHIDs'
)
->
setConduitKey
(
'subscribers'
)
->
setAliases
(
array
(
'subscriber'
,
'subscribers'
))
->
setDescription
(
pht
(
'Search for objects with certain subscribers.'
));
return
$fields
;
}
}
Event Timeline
Log In to Comment