Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94945741
DiffusionCommitFulltextEngine.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
Wed, Dec 11, 14:55
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Dec 13, 14:55 (2 d)
Engine
blob
Format
Raw Data
Handle
22904028
Attached To
rPH Phabricator
DiffusionCommitFulltextEngine.php
View Options
<?php
final
class
DiffusionCommitFulltextEngine
extends
PhabricatorFulltextEngine
{
protected
function
buildAbstractDocument
(
PhabricatorSearchAbstractDocument
$document
,
$object
)
{
$commit
=
id
(
new
DiffusionCommitQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withPHIDs
(
array
(
$object
->
getPHID
()))
->
needCommitData
(
true
)
->
executeOne
();
$repository
=
$commit
->
getRepository
();
$commit_data
=
$commit
->
getCommitData
();
$date_created
=
$commit
->
getEpoch
();
$commit_message
=
$commit_data
->
getCommitMessage
();
$author_phid
=
$commit_data
->
getCommitDetail
(
'authorPHID'
);
$monogram
=
$commit
->
getMonogram
();
$summary
=
$commit_data
->
getSummary
();
$title
=
"{$monogram} {$summary}"
;
$document
->
setDocumentCreated
(
$date_created
)
->
setDocumentModified
(
$date_created
)
->
setDocumentTitle
(
$title
);
$document
->
addField
(
PhabricatorSearchDocumentFieldType
::
FIELD_BODY
,
$commit_message
);
if
(
$author_phid
)
{
$document
->
addRelationship
(
PhabricatorSearchRelationship
::
RELATIONSHIP_AUTHOR
,
$author_phid
,
PhabricatorPeopleUserPHIDType
::
TYPECONST
,
$date_created
);
}
$document
->
addRelationship
(
PhabricatorSearchRelationship
::
RELATIONSHIP_REPOSITORY
,
$repository
->
getPHID
(),
PhabricatorRepositoryRepositoryPHIDType
::
TYPECONST
,
$date_created
);
}
}
Event Timeline
Log In to Comment