Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120160566
PhabricatorCustomFieldEditField.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, Jul 2, 09:08
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jul 4, 09:08 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27123634
Attached To
rPH Phabricator
PhabricatorCustomFieldEditField.php
View Options
<?php
final
class
PhabricatorCustomFieldEditField
extends
PhabricatorEditField
{
private
$customField
;
public
function
setCustomField
(
PhabricatorCustomField
$custom_field
)
{
$this
->
customField
=
$custom_field
;
return
$this
;
}
public
function
getCustomField
()
{
return
$this
->
customField
;
}
protected
function
buildControl
()
{
$field
=
$this
->
getCustomField
();
$clone
=
clone
$field
;
if
(
$this
->
getIsSubmittedForm
())
{
$value
=
$this
->
getValue
();
$clone
->
setValueFromApplicationTransactions
(
$value
);
}
return
$clone
->
renderEditControl
(
array
());
}
protected
function
newEditType
()
{
return
id
(
new
PhabricatorCustomFieldEditType
())
->
setCustomField
(
$this
->
getCustomField
());
}
public
function
getValueForTransaction
()
{
$value
=
$this
->
getValue
();
$field
=
$this
->
getCustomField
();
// Avoid changing the value of the field itself, since later calls would
// incorrectly reflect the new value.
$clone
=
clone
$field
;
$clone
->
setValueFromApplicationTransactions
(
$value
);
return
$clone
->
getNewValueForApplicationTransactions
();
}
protected
function
getValueExistsInRequest
(
AphrontRequest
$request
,
$key
)
{
// For now, never read these out of the request.
return
false
;
}
protected
function
getValueExistsInSubmit
(
AphrontRequest
$request
,
$key
)
{
return
true
;
}
protected
function
getValueFromSubmit
(
AphrontRequest
$request
,
$key
)
{
$field
=
$this
->
getCustomField
();
$clone
=
clone
$field
;
$clone
->
readValueFromRequest
(
$request
);
return
$clone
->
getNewValueForApplicationTransactions
();
}
public
function
getConduitEditTypes
()
{
// TODO: For now, don't support custom fields over Conduit.
return
array
();
}
protected
function
newHTTPParameterType
()
{
// TODO: For now, don't support custom fields for HTTP prefill.
return
null
;
}
}
Event Timeline
Log In to Comment