Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77840538
DifferentialRepositoryField.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, Aug 16, 17:41
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Aug 18, 17:41 (2 d)
Engine
blob
Format
Raw Data
Handle
19930220
Attached To
rPH Phabricator
DifferentialRepositoryField.php
View Options
<?php
final
class
DifferentialRepositoryField
extends
DifferentialCoreCustomField
{
public
function
getFieldKey
()
{
return
'differential:repository'
;
}
public
function
getFieldName
()
{
return
pht
(
'Repository'
);
}
public
function
getFieldDescription
()
{
return
pht
(
'Associates a revision with a repository.'
);
}
protected
function
readValueFromRevision
(
DifferentialRevision
$revision
)
{
return
$revision
->
getRepositoryPHID
();
}
public
function
shouldAppearInPropertyView
()
{
return
true
;
}
public
function
renderPropertyViewValue
(
array
$handles
)
{
return
null
;
}
public
function
shouldAppearInDiffPropertyView
()
{
return
true
;
}
public
function
renderDiffPropertyViewLabel
(
DifferentialDiff
$diff
)
{
return
$this
->
getFieldName
();
}
public
function
renderDiffPropertyViewValue
(
DifferentialDiff
$diff
)
{
if
(!
$diff
->
getRepositoryPHID
())
{
return
null
;
}
return
$this
->
getViewer
()->
renderHandle
(
$diff
->
getRepositoryPHID
());
}
public
function
shouldAppearInTransactionMail
()
{
return
true
;
}
public
function
updateTransactionMailBody
(
PhabricatorMetaMTAMailBody
$body
,
PhabricatorApplicationTransactionEditor
$editor
,
array
$xactions
)
{
$repository
=
$this
->
getObject
()->
getRepository
();
if
(
$repository
===
null
)
{
return
;
}
$body
->
addTextSection
(
pht
(
'REPOSITORY'
),
$repository
->
getMonogram
().
' '
.
$repository
->
getName
());
}
}
Event Timeline
Log In to Comment