Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F957511
DifferentialCommitsFieldSpecification.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DifferentialCommitsFieldSpecification.php
View Options
<?php
final
class
DifferentialCommitsFieldSpecification
extends
DifferentialFieldSpecification
{
public
function
shouldAppearOnRevisionView
()
{
return
true
;
}
public
function
getRequiredHandlePHIDsForRevisionView
()
{
return
$this
->
getCommitPHIDs
();
}
public
function
renderLabelForRevisionView
()
{
return
'Commits:'
;
}
public
function
renderValueForRevisionView
()
{
$commit_phids
=
$this
->
getCommitPHIDs
();
if
(!
$commit_phids
)
{
return
null
;
}
$links
=
array
();
foreach
(
$commit_phids
as
$commit_phid
)
{
$links
[]
=
$this
->
getHandle
(
$commit_phid
)->
renderLink
();
}
return
phutil_implode_html
(
phutil_tag
(
'br'
),
$links
);
}
private
function
getCommitPHIDs
()
{
$revision
=
$this
->
getRevision
();
return
$revision
->
getCommitPHIDs
();
}
public
function
renderValueForMail
(
$phase
)
{
$revision
=
$this
->
getRevision
();
if
(
$revision
->
getStatus
()
!=
ArcanistDifferentialRevisionStatus
::
CLOSED
)
{
return
null
;
}
$phids
=
$revision
->
loadCommitPHIDs
();
if
(!
$phids
)
{
return
null
;
}
$body
=
array
();
$handles
=
id
(
new
PhabricatorObjectHandleData
(
$phids
))->
loadHandles
();
$body
[]
=
pht
(
'COMMIT(S)'
,
count
(
$handles
));
foreach
(
$handles
as
$handle
)
{
$body
[]
=
' '
.
PhabricatorEnv
::
getProductionURI
(
$handle
->
getURI
());
}
return
implode
(
"
\n
"
,
$body
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 7:22 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227179
Default Alt Text
DifferentialCommitsFieldSpecification.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment