Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108359446
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
Wed, Apr 16, 04:51
Size
814 B
Mime Type
text/x-php
Expires
Fri, Apr 18, 04:51 (1 d, 8 h)
Engine
blob
Format
Raw Data
Handle
25546626
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