Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F465040
PhabricatorSearchCheckboxesField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 10:16 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
74304
Default Alt Text
PhabricatorSearchCheckboxesField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment