Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100834176
PhabricatorTransactionsFulltextEngineExtension.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
Mon, Feb 3, 03:29
Size
1022 B
Mime Type
text/x-php
Expires
Wed, Feb 5, 03:29 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24041719
Attached To
rPH Phabricator
PhabricatorTransactionsFulltextEngineExtension.php
View Options
<?php
final
class
PhabricatorTransactionsFulltextEngineExtension
extends
PhabricatorFulltextEngineExtension
{
const
EXTENSIONKEY
=
'transactions'
;
public
function
getExtensionName
()
{
return
pht
(
'Comments'
);
}
public
function
shouldIndexFulltextObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorApplicationTransactionInterface
);
}
public
function
indexFulltextObject
(
$object
,
PhabricatorSearchAbstractDocument
$document
)
{
$query
=
PhabricatorApplicationTransactionQuery
::
newQueryForObject
(
$object
);
if
(!
$query
)
{
return
;
}
$xactions
=
$query
->
setViewer
(
$this
->
getViewer
())
->
withObjectPHIDs
(
array
(
$object
->
getPHID
()))
->
needComments
(
true
)
->
execute
();
foreach
(
$xactions
as
$xaction
)
{
if
(!
$xaction
->
hasComment
())
{
continue
;
}
$comment
=
$xaction
->
getComment
();
$document
->
addField
(
PhabricatorSearchDocumentFieldType
::
FIELD_COMMENT
,
$comment
->
getContent
());
}
}
}
Event Timeline
Log In to Comment