Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F548305
PhorgeFlagFlaggedObjectCustomField.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
PhorgeFlagFlaggedObjectCustomField.php
View Options
<?php
final
class
PhorgeFlagFlaggedObjectCustomField
extends
PhabricatorCustomField
{
private
$flag
;
public
function
getFieldKey
()
{
return
'flag:flag'
;
}
public
function
shouldAppearInPropertyView
()
{
return
false
;
}
public
function
shouldAppearInListView
()
{
return
true
;
}
public
function
renderOnListItem
(
PHUIObjectItemView
$view
)
{
if
(!
$this
->
flag
)
{
return
;
}
// I'm very open to improvements in the way a Flag is displayed
$icon
=
PhabricatorFlagColor
::
getIcon
(
$this
->
flag
->
getColor
());
$view
->
addIcon
(
$icon
);
}
public
function
shouldUseStorage
()
{
return
true
;
}
public
function
setValueFromStorage
(
$value
)
{
$this
->
flag
=
$value
;
}
// The parent function is defined to return a PhabricatorCustomFieldStorage,
// but that assumes a DTO with a particular form; That doesn't apply here.
// Maybe the function needs to be re-defined with a suitable interface.
// For now, PhorgeFlagFlaggedObjectFieldStorage just duck-types into the
// right shape.
public
function
newStorageObject
()
{
return
id
(
new
PhorgeFlagFlaggedObjectFieldStorage
())
->
setViewer
(
$this
->
getViewer
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:47 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
105155
Default Alt Text
PhorgeFlagFlaggedObjectCustomField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment