Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99225616
PhabricatorSearchThreeStateField.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, Jan 22, 14:00
Size
939 B
Mime Type
text/x-php
Expires
Fri, Jan 24, 14:00 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
23736226
Attached To
rPH Phabricator
PhabricatorSearchThreeStateField.php
View Options
<?php
final
class
PhabricatorSearchThreeStateField
extends
PhabricatorSearchField
{
private
$options
;
public
function
setOptions
(
$null
,
$yes
,
$no
)
{
$this
->
options
=
array
(
''
=>
$null
,
'true'
=>
$yes
,
'false'
=>
$no
,
);
return
$this
;
}
public
function
getOptions
()
{
return
$this
->
options
;
}
protected
function
getDefaultValue
()
{
return
null
;
}
protected
function
getValueFromRequest
(
AphrontRequest
$request
,
$key
)
{
if
(!
strlen
(
$request
->
getStr
(
$key
)))
{
return
null
;
}
return
$request
->
getBool
(
$key
);
}
protected
function
newControl
()
{
return
id
(
new
AphrontFormSelectControl
())
->
setOptions
(
$this
->
getOptions
());
}
protected
function
getValueForControl
()
{
$value
=
parent
::
getValueForControl
();
if
(
$value
===
true
)
{
return
'true'
;
}
if
(
$value
===
false
)
{
return
'false'
;
}
return
null
;
}
}
Event Timeline
Log In to Comment