Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100491289
DiffusionCommitAuthorProjectsHeraldField.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, Jan 31, 05:33
Size
848 B
Mime Type
text/x-php
Expires
Sun, Feb 2, 05:33 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23979395
Attached To
rPH Phabricator
DiffusionCommitAuthorProjectsHeraldField.php
View Options
<?php
final
class
DiffusionCommitAuthorProjectsHeraldField
extends
DiffusionCommitHeraldField
{
const
FIELDCONST
=
'diffusion.commit.author.projects'
;
public
function
getHeraldFieldName
()
{
return
pht
(
"Author's projects"
);
}
public
function
getHeraldFieldValue
(
$object
)
{
$adapter
=
$this
->
getAdapter
();
$phid
=
$object
->
getCommitData
()->
getCommitDetail
(
'authorPHID'
);
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