Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91426676
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
Mon, Nov 11, 00:16
Size
892 B
Mime Type
text/x-php
Expires
Wed, Nov 13, 00:16 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22261603
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