3 final class PhabricatorSearchOrderField
4 extends PhabricatorSearchField
{
9 public function setOrderAliases(array $order_aliases) {
10 $this->orderAliases
= $order_aliases;
14 public function getOrderAliases() {
15 return $this->orderAliases
;
18 public function setOptions(array $options) {
19 $this->options
= $options;
23 public function getOptions() {
24 return $this->options
;
27 protected function getDefaultValue() {
31 protected function getValueFromRequest(AphrontRequest
$request, $key) {
32 return $request->getStr($key);
35 protected function getValueForControl() {
36 // If the SavedQuery has an alias for an order, map it to the canonical
37 // name for the order so the correct option is selected in the dropdown.
38 $value = parent
::getValueForControl();
39 if (isset($this->orderAliases
[$value])) {
40 $value = $this->orderAliases
[$value];
45 protected function newControl() {
46 return id(new AphrontFormSelectControl())
47 ->setOptions($this->getOptions());