Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96294159
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, Dec 24, 17:20
Size
941 B
Mime Type
text/x-php
Expires
Thu, Dec 26, 17:20 (1 d, 11 h)
Engine
blob
Format
Raw Data
Handle
23152256
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