Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120086530
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
Tue, Jul 1, 20:22
Size
1014 B
Mime Type
text/x-php
Expires
Thu, Jul 3, 20:22 (2 d)
Engine
blob
Format
Raw Data
Handle
27136352
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