Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80283557
DiffusionCommitAuditorsHeraldField.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
Fri, Aug 30, 22:39
Size
892 B
Mime Type
text/x-php
Expires
Sun, Sep 1, 22:39 (2 d)
Engine
blob
Format
Raw Data
Handle
20335579
Attached To
rPH Phabricator
DiffusionCommitAuditorsHeraldField.php
View Options
<?php
final
class
DiffusionCommitAuditorsHeraldField
extends
DiffusionCommitHeraldField
{
const
FIELDCONST
=
'diffusion.commit.auditors'
;
public
function
getHeraldFieldName
()
{
return
pht
(
'Auditors'
);
}
public
function
getHeraldFieldValue
(
$object
)
{
$viewer
=
PhabricatorUser
::
getOmnipotentUser
();
$commit
=
id
(
new
DiffusionCommitQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$object
->
getPHID
()))
->
needAuditRequests
(
true
)
->
executeOne
();
$audits
=
$commit
->
getAudits
();
$phids
=
array
();
foreach
(
$audits
as
$audit
)
{
if
(
$audit
->
isActiveAudit
())
{
$phids
[]
=
$audit
->
getAuditorPHID
();
}
}
return
$phids
;
}
protected
function
getHeraldFieldStandardType
()
{
return
self
::
STANDARD_PHID_LIST
;
}
protected
function
getDatasource
()
{
return
new
DiffusionAuditorDatasource
();
}
}
Event Timeline
Log In to Comment