Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91415912
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
Sun, Nov 10, 21:50
Size
941 B
Mime Type
text/x-php
Expires
Tue, Nov 12, 21:50 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22260070
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