Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97578445
PhabricatorProjectSearchIndexer.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, Jan 5, 10:16
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jan 7, 10:16 (2 d)
Engine
blob
Format
Raw Data
Handle
23430217
Attached To
rPH Phabricator
PhabricatorProjectSearchIndexer.php
View Options
<?php
final
class
PhabricatorProjectSearchIndexer
extends
PhabricatorSearchDocumentIndexer
{
public
function
getIndexableObject
()
{
return
new
PhabricatorProject
();
}
protected
function
buildAbstractDocumentByPHID
(
$phid
)
{
$project
=
$this
->
loadDocumentByPHID
(
$phid
);
$doc
=
new
PhabricatorSearchAbstractDocument
();
$doc
->
setPHID
(
$project
->
getPHID
());
$doc
->
setDocumentType
(
PhabricatorProjectProjectPHIDType
::
TYPECONST
);
$doc
->
setDocumentTitle
(
$project
->
getName
());
$doc
->
setDocumentCreated
(
$project
->
getDateCreated
());
$doc
->
setDocumentModified
(
$project
->
getDateModified
());
$doc
->
addRelationship
(
$project
->
isArchived
()
?
PhabricatorSearchRelationship
::
RELATIONSHIP_CLOSED
:
PhabricatorSearchRelationship
::
RELATIONSHIP_OPEN
,
$project
->
getPHID
(),
PhabricatorProjectProjectPHIDType
::
TYPECONST
,
time
());
// NOTE: This could be more full-featured, but for now we're mostly
// interested in the side effects of indexing.
return
$doc
;
}
}
Event Timeline
Log In to Comment