Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F548626
PhabricatorSelectEditField.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
PhabricatorSelectEditField.php
View Options
<?php
final
class
PhabricatorSelectEditField
extends
PhabricatorEditField
{
private
$options
;
private
$optionAliases
=
array
();
public
function
setOptions
(
array
$options
)
{
$this
->
options
=
$options
;
return
$this
;
}
public
function
getOptions
()
{
if
(
$this
->
options
===
null
)
{
throw
new
PhutilInvalidStateException
(
'setOptions'
);
}
return
$this
->
options
;
}
public
function
setOptionAliases
(
array
$option_aliases
)
{
$this
->
optionAliases
=
$option_aliases
;
return
$this
;
}
public
function
getOptionAliases
()
{
return
$this
->
optionAliases
;
}
protected
function
getDefaultValueFromConfiguration
(
$value
)
{
return
$this
->
getCanonicalValue
(
$value
);
}
protected
function
getValueForControl
()
{
$value
=
parent
::
getValueForControl
();
return
$this
->
getCanonicalValue
(
$value
);
}
protected
function
newControl
()
{
return
id
(
new
AphrontFormSelectControl
())
->
setOptions
(
$this
->
getOptions
());
}
protected
function
newHTTPParameterType
()
{
return
new
AphrontSelectHTTPParameterType
();
}
protected
function
newCommentAction
()
{
return
id
(
new
PhabricatorEditEngineSelectCommentAction
())
->
setOptions
(
$this
->
getOptions
());
}
protected
function
newConduitParameterType
()
{
return
new
ConduitStringParameterType
();
}
protected
function
newBulkParameterType
()
{
return
id
(
new
BulkSelectParameterType
())
->
setOptions
(
$this
->
getOptions
());
}
private
function
getCanonicalValue
(
$value
)
{
$options
=
$this
->
getOptions
();
if
(!
isset
(
$options
[
$value
]))
{
$aliases
=
$this
->
getOptionAliases
();
if
(
isset
(
$aliases
[
$value
]))
{
$value
=
$aliases
[
$value
];
}
}
return
$value
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:52 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
109896
Default Alt Text
PhabricatorSelectEditField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment