2015-06-08 21:20:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorSearchSelectField
|
|
|
|
extends PhabricatorSearchField {
|
|
|
|
|
|
|
|
private $options;
|
2015-06-08 21:22:09 +02:00
|
|
|
private $default;
|
2015-06-08 21:20:16 +02:00
|
|
|
|
|
|
|
public function setOptions(array $options) {
|
|
|
|
$this->options = $options;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getOptions() {
|
|
|
|
return $this->options;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getDefaultValue() {
|
2015-06-08 21:22:09 +02:00
|
|
|
return $this->default;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setDefault($default) {
|
|
|
|
$this->default = $default;
|
|
|
|
return $this;
|
2015-06-08 21:20:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function getValueFromRequest(AphrontRequest $request, $key) {
|
|
|
|
return $request->getStr($key);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function newControl() {
|
|
|
|
return id(new AphrontFormSelectControl())
|
|
|
|
->setOptions($this->getOptions());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|