Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101185037
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
Thu, Feb 6, 14:14
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Feb 8, 14:14 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24108446
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'
);
$title
=
'r'
.
$repository
->
getCallsign
().
$commit
->
getCommitIdentifier
().
' '
.
$commit_data
->
getSummary
();
$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