Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82939824
PhabricatorCustomFieldEditType.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
Sat, Sep 14, 08:18
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Sep 16, 08:18 (2 d)
Engine
blob
Format
Raw Data
Handle
20776276
Attached To
rPH Phabricator
PhabricatorCustomFieldEditType.php
View Options
<?php
final
class
PhabricatorCustomFieldEditType
extends
PhabricatorEditType
{
private
$customField
;
public
function
setCustomField
(
PhabricatorCustomField
$custom_field
)
{
$this
->
customField
=
$custom_field
;
return
$this
;
}
public
function
getCustomField
()
{
return
$this
->
customField
;
}
public
function
getMetadata
()
{
$field
=
$this
->
getCustomField
();
return
parent
::
getMetadata
()
+
$field
->
getApplicationTransactionMetadata
();
}
public
function
generateTransactions
(
PhabricatorApplicationTransaction
$template
,
array
$spec
)
{
$value
=
idx
(
$spec
,
'value'
);
$xaction
=
$this
->
newTransaction
(
$template
)
->
setNewValue
(
$value
);
$custom_type
=
PhabricatorTransactions
::
TYPE_CUSTOMFIELD
;
if
(
$xaction
->
getTransactionType
()
==
$custom_type
)
{
$field
=
$this
->
getCustomField
();
$xaction
->
setOldValue
(
$field
->
getOldValueForApplicationTransactions
())
->
setMetadataValue
(
'customfield:key'
,
$field
->
getFieldKey
());
}
return
array
(
$xaction
);
}
}
Event Timeline
Log In to Comment