Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104742741
DifferentialCustomField.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
Wed, Mar 12, 00:24
Size
2 KB
Mime Type
text/x-php
Expires
Fri, Mar 14, 00:24 (2 d)
Engine
blob
Format
Raw Data
Handle
24853923
Attached To
rPH Phabricator
DifferentialCustomField.php
View Options
<?php
/**
* @task commitmessage Integration with Commit Messages
* @task diff Integration with Diff Properties
*/
abstract
class
DifferentialCustomField
extends
PhabricatorCustomField
{
/**
* TODO: It would be nice to remove this, but a lot of different code is
* bound together by it. Until everything is modernized, retaining the old
* field keys is the only reasonable way to update things one piece
* at a time.
*/
public
function
getFieldKeyForConduit
()
{
return
$this
->
getFieldKey
();
}
// TODO: As above.
public
function
getModernFieldKey
()
{
return
$this
->
getFieldKeyForConduit
();
}
protected
function
parseObjectList
(
$value
,
array
$types
,
$allow_partial
=
false
,
array
$suffixes
=
array
())
{
return
id
(
new
PhabricatorObjectListQuery
())
->
setViewer
(
$this
->
getViewer
())
->
setAllowedTypes
(
$types
)
->
setObjectList
(
$value
)
->
setAllowPartialResults
(
$allow_partial
)
->
setSuffixes
(
$suffixes
)
->
execute
();
}
protected
function
renderObjectList
(
array
$handles
,
array
$suffixes
=
array
())
{
if
(!
$handles
)
{
return
null
;
}
$out
=
array
();
foreach
(
$handles
as
$handle
)
{
$phid
=
$handle
->
getPHID
();
if
(
$handle
->
getPolicyFiltered
())
{
$token
=
$phid
;
}
else
if
(
$handle
->
isComplete
())
{
$token
=
$handle
->
getCommandLineObjectName
();
}
$suffix
=
idx
(
$suffixes
,
$phid
);
$token
=
$token
.
$suffix
;
$out
[]
=
$token
;
}
return
implode
(
', '
,
$out
);
}
public
function
getWarningsForDetailView
()
{
if
(
$this
->
getProxy
())
{
return
$this
->
getProxy
()->
getWarningsForDetailView
();
}
return
array
();
}
public
function
getRequiredHandlePHIDsForRevisionHeaderWarnings
()
{
return
array
();
}
public
function
getWarningsForRevisionHeader
(
array
$handles
)
{
return
array
();
}
/* -( Integration with Commit Messages )----------------------------------- */
/**
* @task commitmessage
*/
public
function
getProTips
()
{
if
(
$this
->
getProxy
())
{
return
$this
->
getProxy
()->
getProTips
();
}
return
array
();
}
/* -( Integration with Diff Properties )----------------------------------- */
/**
* @task diff
*/
public
function
shouldAppearInDiffPropertyView
()
{
if
(
$this
->
getProxy
())
{
return
$this
->
getProxy
()->
shouldAppearInDiffPropertyView
();
}
return
false
;
}
/**
* @task diff
*/
public
function
renderDiffPropertyViewLabel
(
DifferentialDiff
$diff
)
{
if
(
$this
->
getProxy
())
{
return
$this
->
getProxy
()->
renderDiffPropertyViewLabel
(
$diff
);
}
return
$this
->
getFieldName
();
}
/**
* @task diff
*/
public
function
renderDiffPropertyViewValue
(
DifferentialDiff
$diff
)
{
if
(
$this
->
getProxy
())
{
return
$this
->
getProxy
()->
renderDiffPropertyViewValue
(
$diff
);
}
throw
new
PhabricatorCustomFieldImplementationIncompleteException
(
$this
);
}
}
Event Timeline
Log In to Comment