Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96133369
DifferentialArcanistProjectFieldSpecification.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
Sun, Dec 22, 23:55
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Dec 24, 23:55 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23129695
Attached To
rPH Phabricator
DifferentialArcanistProjectFieldSpecification.php
View Options
<?php
final
class
DifferentialArcanistProjectFieldSpecification
extends
DifferentialFieldSpecification
{
public
function
shouldAppearOnRevisionView
()
{
return
true
;
}
public
function
getRequiredHandlePHIDs
()
{
$arcanist_phid
=
$this
->
getArcanistProjectPHID
();
if
(!
$arcanist_phid
)
{
return
array
();
}
return
array
(
$arcanist_phid
);
}
public
function
renderLabelForRevisionView
()
{
return
'Arcanist Project:'
;
}
public
function
renderValueForRevisionView
()
{
$arcanist_phid
=
$this
->
getArcanistProjectPHID
();
if
(!
$arcanist_phid
)
{
return
null
;
}
$handle
=
$this
->
getHandle
(
$arcanist_phid
);
return
$handle
->
getName
();
}
private
function
getArcanistProjectPHID
()
{
$diff
=
$this
->
getDiff
();
return
$diff
->
getArcanistProjectPHID
();
}
public
function
renderValueForMail
(
$phase
)
{
$status
=
$this
->
getRevision
()->
getStatus
();
if
(
$status
!=
ArcanistDifferentialRevisionStatus
::
NEEDS_REVISION
&&
$status
!=
ArcanistDifferentialRevisionStatus
::
ACCEPTED
)
{
return
null
;
}
$diff
=
$this
->
getRevision
()->
loadActiveDiff
();
if
(
$diff
)
{
$phid
=
$diff
->
getArcanistProjectPHID
();
if
(
$phid
)
{
$handle
=
id
(
new
PhabricatorHandleQuery
())
->
setViewer
(
$this
->
getUser
())
->
withPHIDs
(
array
(
$phid
))
->
executeOne
();
return
"ARCANIST PROJECT
\n
"
.
$handle
->
getName
();
}
}
}
}
Event Timeline
Log In to Comment