Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101298546
DiffusionPreCommitContentCommitterProjectsHeraldField.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, Feb 7, 14:20
Size
854 B
Mime Type
text/x-php
Expires
Sun, Feb 9, 14:20 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24125590
Attached To
rPH Phabricator
DiffusionPreCommitContentCommitterProjectsHeraldField.php
View Options
<?php
final
class
DiffusionPreCommitContentCommitterProjectsHeraldField
extends
DiffusionPreCommitContentHeraldField
{
const
FIELDCONST
=
'diffusion.pre.commit.committer.projects'
;
public
function
getHeraldFieldName
()
{
return
pht
(
"Committer's projects"
);
}
public
function
getHeraldFieldValue
(
$object
)
{
$adapter
=
$this
->
getAdapter
();
$phid
=
$adapter
->
getCommitterPHID
();
if
(!
$phid
)
{
return
array
();
}
$viewer
=
$adapter
->
getViewer
();
$projects
=
id
(
new
PhabricatorProjectQuery
())
->
setViewer
(
$viewer
)
->
withMemberPHIDs
(
array
(
$phid
))
->
execute
();
return
mpull
(
$projects
,
'getPHID'
);
}
protected
function
getHeraldFieldStandardType
()
{
return
self
::
STANDARD_PHID_LIST
;
}
protected
function
getDatasource
()
{
return
new
PhabricatorProjectDatasource
();
}
}
Event Timeline
Log In to Comment