Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100712639
PhabricatorSubscriptionsFulltextEngineExtension.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
Sun, Feb 2, 02:58
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Feb 4, 02:58 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
24016822
Attached To
rPH Phabricator
PhabricatorSubscriptionsFulltextEngineExtension.php
View Options
<?php
final
class
PhabricatorSubscriptionsFulltextEngineExtension
extends
PhabricatorFulltextEngineExtension
{
const
EXTENSIONKEY
=
'subscriptions'
;
public
function
getExtensionName
()
{
return
pht
(
'Subscribers'
);
}
public
function
shouldEnrichFulltextObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorSubscribableInterface
);
}
public
function
enrichFulltextObject
(
$object
,
PhabricatorSearchAbstractDocument
$document
)
{
$subscriber_phids
=
PhabricatorSubscribersQuery
::
loadSubscribersForPHID
(
$object
->
getPHID
());
if
(!
$subscriber_phids
)
{
return
;
}
$handles
=
id
(
new
PhabricatorHandleQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withPHIDs
(
$subscriber_phids
)
->
execute
();
foreach
(
$handles
as
$phid
=>
$handle
)
{
$document
->
addRelationship
(
PhabricatorSearchRelationship
::
RELATIONSHIP_SUBSCRIBER
,
$phid
,
$handle
->
getType
(),
$document
->
getDocumentModified
());
// Bogus timestamp.
}
}
}
Event Timeline
Log In to Comment