Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99378957
PhabricatorSearchOrderField.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
Fri, Jan 24, 00:46
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 26, 00:46 (2 d)
Engine
blob
Format
Raw Data
Handle
23789709
Attached To
rPH Phabricator
PhabricatorSearchOrderField.php
View Options
<?php
final
class
PhabricatorSearchOrderField
extends
PhabricatorSearchField
{
private
$options
;
private
$orderAliases
;
public
function
setOrderAliases
(
array
$order_aliases
)
{
$this
->
orderAliases
=
$order_aliases
;
return
$this
;
}
public
function
getOrderAliases
()
{
return
$this
->
orderAliases
;
}
public
function
setOptions
(
array
$options
)
{
$this
->
options
=
$options
;
return
$this
;
}
public
function
getOptions
()
{
return
$this
->
options
;
}
protected
function
getDefaultValue
()
{
return
null
;
}
protected
function
getValueFromRequest
(
AphrontRequest
$request
,
$key
)
{
return
$request
->
getStr
(
$key
);
}
protected
function
getValueForControl
()
{
// If the SavedQuery has an alias for an order, map it to the canonical
// name for the order so the correct option is selected in the dropdown.
$value
=
parent
::
getValueForControl
();
if
(
isset
(
$this
->
orderAliases
[
$value
]))
{
$value
=
$this
->
orderAliases
[
$value
];
}
return
$value
;
}
protected
function
newControl
()
{
return
id
(
new
AphrontFormSelectControl
())
->
setOptions
(
$this
->
getOptions
());
}
}
Event Timeline
Log In to Comment