Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97262208
ReleephAuthorFieldSpecification.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 3, 21:20
Size
1014 B
Mime Type
text/x-php
Expires
Sun, Jan 5, 21:20 (2 d)
Engine
blob
Format
Raw Data
Handle
23368266
Attached To
rPH Phabricator
ReleephAuthorFieldSpecification.php
View Options
<?php
final
class
ReleephAuthorFieldSpecification
extends
ReleephFieldSpecification
{
private
static
$authorMap
=
array
();
public
function
bulkLoad
(
array
$releeph_requests
)
{
foreach
(
$releeph_requests
as
$releeph_request
)
{
$commit
=
$releeph_request
->
loadPhabricatorRepositoryCommit
();
if
(
$commit
)
{
$author_phid
=
$commit
->
getAuthorPHID
();
self
::
$authorMap
[
$releeph_request
->
getPHID
()]
=
$author_phid
;
}
}
ReleephUserView
::
getNewInstance
()
->
setUser
(
$this
->
getUser
())
->
setReleephProject
(
$this
->
getReleephProject
())
->
load
(
self
::
$authorMap
);
}
public
function
getName
()
{
return
'Author'
;
}
public
function
renderValueForHeaderView
()
{
$rr
=
$this
->
getReleephRequest
();
$author_phid
=
idx
(
self
::
$authorMap
,
$rr
->
getPHID
());
if
(
$author_phid
)
{
return
ReleephUserView
::
getNewInstance
()
->
setRenderUserPHID
(
$author_phid
)
->
render
();
}
else
{
return
'Unknown Author'
;
}
}
}
Event Timeline
Log In to Comment