Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96248258
DifferentialReviewersSearchEngineAttachment.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, 03:37
Size
1017 B
Mime Type
text/x-php
Expires
Thu, Dec 26, 03:37 (1 d, 10 h)
Engine
blob
Format
Raw Data
Handle
23148596
Attached To
rPH Phabricator
DifferentialReviewersSearchEngineAttachment.php
View Options
<?php
final
class
DifferentialReviewersSearchEngineAttachment
extends
PhabricatorSearchEngineAttachment
{
public
function
getAttachmentName
()
{
return
pht
(
'Differential Reviewers'
);
}
public
function
getAttachmentDescription
()
{
return
pht
(
'Get the reviewers for each revision.'
);
}
public
function
willLoadAttachmentData
(
$query
,
$spec
)
{
$query
->
needReviewers
(
true
);
}
public
function
getAttachmentForObject
(
$object
,
$data
,
$spec
)
{
$reviewers
=
$object
->
getReviewers
();
$status_blocking
=
DifferentialReviewerStatus
::
STATUS_BLOCKING
;
$list
=
array
();
foreach
(
$reviewers
as
$reviewer
)
{
$status
=
$reviewer
->
getReviewerStatus
();
$is_blocking
=
(
$status
==
$status_blocking
);
$list
[]
=
array
(
'reviewerPHID'
=>
$reviewer
->
getReviewerPHID
(),
'status'
=>
$status
,
'isBlocking'
=>
$is_blocking
,
'actorPHID'
=>
$reviewer
->
getLastActorPHID
(),
);
}
return
array
(
'reviewers'
=>
$list
,
);
}
}
Event Timeline
Log In to Comment