Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892366
DifferentialRepositoryField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
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
(
)
)
;
}
public
function
shouldAppearInListView
(
)
{
return
true
;
}
public
function
renderOnListItem
(
PHUIObjectItemView
$view
)
{
if
(
$this
->
getValue
(
)
)
{
$handle
=
$this
->
getViewer
(
)
->
renderHandle
(
$this
->
getValue
(
)
)
;
$view
->
addByLine
(
pht
(
'Repository: %s'
,
$handle
)
)
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 16:42 (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1116385
Default Alt Text
DifferentialRepositoryField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment