Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100842769
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
Mon, Feb 3, 05:07
Size
814 B
Mime Type
text/x-php
Expires
Wed, Feb 5, 05:07 (2 d)
Engine
blob
Format
Raw Data
Handle
24040574
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
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
;
}
}
Event Timeline
Log In to Comment