Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92730254
PhabricatorSearchDateControlField.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
Sat, Nov 23, 05:28
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Nov 25, 05:28 (2 d)
Engine
blob
Format
Raw Data
Handle
22499070
Attached To
rPH Phabricator
PhabricatorSearchDateControlField.php
View Options
<?php
final
class
PhabricatorSearchDateControlField
extends
PhabricatorSearchField
{
protected
function
getValueExistsInRequest
(
AphrontRequest
$request
,
$key
)
{
// The control doesn't actually submit a value with the same name as the
// key, so look for the "_d" value instead, which has the date part of the
// control value.
return
$request
->
getExists
(
$key
.
'_d'
);
}
protected
function
getValueFromRequest
(
AphrontRequest
$request
,
$key
)
{
$value
=
AphrontFormDateControlValue
::
newFromRequest
(
$request
,
$key
);
$value
->
setOptional
(
true
);
return
$value
->
getDictionary
();
}
protected
function
newControl
()
{
return
id
(
new
AphrontFormDateControl
())
->
setAllowNull
(
true
);
}
protected
function
didReadValueFromSavedQuery
(
$value
)
{
if
(!
$value
)
{
return
null
;
}
if
(
$value
instanceof
AphrontFormDateControlValue
&&
$value
->
getEpoch
())
{
return
$value
->
setOptional
(
true
);
}
$value
=
AphrontFormDateControlValue
::
newFromWild
(
$this
->
getViewer
(),
$value
);
return
$value
->
setOptional
(
true
);
}
}
Event Timeline
Log In to Comment