Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F76498698
AphrontBoolHTTPParameterType.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
Thu, Aug 8, 07:39
Size
899 B
Mime Type
text/x-php
Expires
Sat, Aug 10, 07:39 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
19723951
Attached To
rPH Phabricator
AphrontBoolHTTPParameterType.php
View Options
<?php
final
class
AphrontBoolHTTPParameterType
extends
AphrontHTTPParameterType
{
protected
function
getParameterExists
(
AphrontRequest
$request
,
$key
)
{
if
(
$request
->
getExists
(
$key
))
{
return
true
;
}
$checkbox_key
=
$this
->
getCheckboxKey
(
$key
);
if
(
$request
->
getExists
(
$checkbox_key
))
{
return
true
;
}
return
false
;
}
protected
function
getParameterValue
(
AphrontRequest
$request
,
$key
)
{
return
(
bool
)
$request
->
getBool
(
$key
);
}
protected
function
getParameterTypeName
()
{
return
'bool'
;
}
protected
function
getParameterFormatDescriptions
()
{
return
array
(
pht
(
'A boolean value (true or false).'
),
);
}
protected
function
getParameterExamples
()
{
return
array
(
'v=true'
,
'v=false'
,
'v=1'
,
'v=0'
,
);
}
public
function
getCheckboxKey
(
$key
)
{
return
"{$key}.exists"
;
}
}
Event Timeline
Log In to Comment