Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99299614
DiffusionPreCommitContentAuthorProjectsHeraldField.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
Thu, Jan 23, 05:49
Size
842 B
Mime Type
text/x-php
Expires
Sat, Jan 25, 05:49 (2 d)
Engine
blob
Format
Raw Data
Handle
23726047
Attached To
rPH Phabricator
DiffusionPreCommitContentAuthorProjectsHeraldField.php
View Options
<?php
final
class
DiffusionPreCommitContentAuthorProjectsHeraldField
extends
DiffusionPreCommitContentHeraldField
{
const
FIELDCONST
=
'diffusion.pre.commit.author.projects'
;
public
function
getHeraldFieldName
()
{
return
pht
(
"Author's projects"
);
}
public
function
getHeraldFieldValue
(
$object
)
{
$adapter
=
$this
->
getAdapter
();
$phid
=
$adapter
->
getAuthorPHID
();
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