Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F548765
DiffusionCommitAuditorsHeraldField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DiffusionCommitAuditorsHeraldField.php
View Options
<?php
final
class
DiffusionCommitAuditorsHeraldField
extends
DiffusionCommitHeraldField
{
const
FIELDCONST
=
'diffusion.commit.auditors'
;
// hide "Auditors" Herald condition if Audit not installed
public
function
supportsObject
(
$object
)
{
if
(
id
(
new
PhabricatorAuditApplication
())->
isInstalled
())
{
return
(
$object
instanceof
PhabricatorRepositoryCommit
);
}
else
{
return
false
;
}
}
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
->
isResigned
())
{
continue
;
}
$phids
[]
=
$audit
->
getAuditorPHID
();
}
return
$phids
;
}
protected
function
getHeraldFieldStandardType
()
{
return
self
::
STANDARD_PHID_LIST
;
}
protected
function
getDatasource
()
{
return
new
DiffusionAuditorDatasource
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:54 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
106252
Default Alt Text
DiffusionCommitAuditorsHeraldField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment