Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F555435
HeraldSelectFieldValue.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
HeraldSelectFieldValue.php
View Options
<?php
final
class
HeraldSelectFieldValue
extends
HeraldFieldValue
{
private
$key
;
private
$options
;
private
$default
;
public
function
setKey
(
$key
)
{
$this
->
key
=
$key
;
return
$this
;
}
public
function
getKey
()
{
return
$this
->
key
;
}
public
function
setOptions
(
array
$options
)
{
$this
->
options
=
$options
;
return
$this
;
}
public
function
getOptions
()
{
return
$this
->
options
;
}
public
function
setDefault
(
$default
)
{
$this
->
default
=
$default
;
return
$this
;
}
public
function
getDefault
()
{
return
$this
->
default
;
}
public
function
getFieldValueKey
()
{
if
(
$this
->
getKey
()
===
null
)
{
throw
new
PhutilInvalidStateException
(
'setKey'
);
}
return
'select.'
.
$this
->
getKey
();
}
public
function
getControlType
()
{
return
self
::
CONTROL_SELECT
;
}
protected
function
getControlTemplate
()
{
if
(
$this
->
getOptions
()
===
null
)
{
throw
new
PhutilInvalidStateException
(
'setOptions'
);
}
return
array
(
'options'
=>
$this
->
getOptions
(),
'default'
=>
$this
->
getDefault
(),
);
}
public
function
renderFieldValue
(
$value
)
{
$options
=
$this
->
getOptions
();
return
idx
(
$options
,
$value
,
$value
);
}
public
function
renderEditorValue
(
$value
)
{
return
$value
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 6:35 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124935
Default Alt Text
HeraldSelectFieldValue.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment