Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98121824
DifferentialProjectReviewersField.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 10, 00:42
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 12, 00:42 (2 d)
Engine
blob
Format
Raw Data
Handle
23510630
Attached To
rPH Phabricator
DifferentialProjectReviewersField.php
View Options
<?php
final
class
DifferentialProjectReviewersField
extends
DifferentialCustomField
{
public
function
getFieldKey
()
{
return
'differential:project-reviewers'
;
}
public
function
getFieldName
()
{
return
pht
(
'Group Reviewers'
);
}
public
function
getFieldDescription
()
{
return
pht
(
'Display project reviewers.'
);
}
public
function
shouldAppearInPropertyView
()
{
return
true
;
}
public
function
canDisableField
()
{
return
false
;
}
public
function
renderPropertyViewLabel
()
{
return
$this
->
getFieldName
();
}
public
function
getRequiredHandlePHIDsForPropertyView
()
{
return
mpull
(
$this
->
getProjectReviewers
(),
'getReviewerPHID'
);
}
public
function
renderPropertyViewValue
(
array
$handles
)
{
$reviewers
=
$this
->
getProjectReviewers
();
if
(!
$reviewers
)
{
return
null
;
}
$view
=
id
(
new
DifferentialReviewersView
())
->
setUser
(
$this
->
getViewer
())
->
setReviewers
(
$reviewers
)
->
setHandles
(
$handles
);
// TODO: Active diff stuff.
return
$view
;
}
private
function
getProjectReviewers
()
{
$reviewers
=
array
();
foreach
(
$this
->
getObject
()->
getReviewerStatus
()
as
$reviewer
)
{
if
(!
$reviewer
->
isUser
())
{
$reviewers
[]
=
$reviewer
;
}
}
return
$reviewers
;
}
}
Event Timeline
Log In to Comment