Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106654053
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
Sat, Mar 29, 11:11
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Mar 31, 12:11 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25245489
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
;
}
protected
function
newConduitParameterType
()
{
return
new
ConduitBoolParameterType
();
}
}
Event Timeline
Log In to Comment