Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92651960
PhabricatorSearchCheckboxesField.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
Fri, Nov 22, 10:00
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 10:00 (2 d)
Engine
blob
Format
Raw Data
Handle
22479409
Attached To
rPH Phabricator
PhabricatorSearchCheckboxesField.php
View Options
<?php
final
class
PhabricatorSearchCheckboxesField
extends
PhabricatorSearchField
{
private
$options
;
public
function
setOptions
(
array
$options
)
{
$this
->
options
=
$options
;
return
$this
;
}
public
function
getOptions
()
{
return
$this
->
options
;
}
protected
function
getDefaultValue
()
{
return
array
();
}
protected
function
didReadValueFromSavedQuery
(
$value
)
{
if
(!
is_array
(
$value
))
{
return
array
();
}
return
$value
;
}
protected
function
getValueFromRequest
(
AphrontRequest
$request
,
$key
)
{
return
$this
->
getListFromRequest
(
$request
,
$key
);
}
protected
function
newControl
()
{
$value
=
array_fuse
(
$this
->
getValue
());
$control
=
new
AphrontFormCheckboxControl
();
foreach
(
$this
->
getOptions
()
as
$key
=>
$option
)
{
$control
->
addCheckbox
(
$this
->
getKey
().
'[]'
,
$key
,
$option
,
isset
(
$value
[
$key
]));
}
return
$control
;
}
protected
function
newConduitParameterType
()
{
return
new
ConduitStringListParameterType
();
}
}
Event Timeline
Log In to Comment