Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93154739
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
Tue, Nov 26, 15:19
Size
941 B
Mime Type
text/x-php
Expires
Thu, Nov 28, 15:19 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22584968
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
shouldIndexFulltextObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorProjectInterface
);
}
public
function
indexFulltextObject
(
$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