Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F109971572
PhabricatorProjectsFulltextEngineExtension.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, Apr 24, 04:46
Size
943 B
Mime Type
text/x-php
Expires
Sat, Apr 26, 04:46 (2 d)
Engine
blob
Format
Raw Data
Handle
25773963
Attached To
rPH Phabricator
PhabricatorProjectsFulltextEngineExtension.php
View Options
<?php
final
class
PhabricatorProjectsFulltextEngineExtension
extends
PhabricatorFulltextEngineExtension
{
const
EXTENSIONKEY
=
'projects'
;
public
function
getExtensionName
()
{
return
pht
(
'Projects'
);
}
public
function
shouldEnrichFulltextObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorProjectInterface
);
}
public
function
enrichFulltextObject
(
$object
,
PhabricatorSearchAbstractDocument
$document
)
{
$project_phids
=
PhabricatorEdgeQuery
::
loadDestinationPHIDs
(
$object
->
getPHID
(),
PhabricatorProjectObjectHasProjectEdgeType
::
EDGECONST
);
if
(!
$project_phids
)
{
return
;
}
foreach
(
$project_phids
as
$project_phid
)
{
$document
->
addRelationship
(
PhabricatorSearchRelationship
::
RELATIONSHIP_PROJECT
,
$project_phid
,
PhabricatorProjectProjectPHIDType
::
TYPECONST
,
$document
->
getDocumentModified
());
// Bogus timestamp.
}
}
}
Event Timeline
Log In to Comment