Remove product literal strings in "pht()", part 18
[phabricator.git] / src / applications / search / field / PhabricatorSearchThreeStateField.php
blobe2e899cb94f3e238762749f40069ea1cae7c4cc7
1 <?php
3 final class PhabricatorSearchThreeStateField
4 extends PhabricatorSearchField {
6 private $options;
8 public function setOptions($null, $yes, $no) {
9 $this->options = array(
10 '' => $null,
11 'true' => $yes,
12 'false' => $no,
14 return $this;
17 public function getOptions() {
18 return $this->options;
21 protected function getDefaultValue() {
22 return null;
25 protected function getValueFromRequest(AphrontRequest $request, $key) {
26 if (!strlen($request->getStr($key))) {
27 return null;
29 return $request->getBool($key);
32 protected function newControl() {
33 return id(new AphrontFormSelectControl())
34 ->setOptions($this->getOptions());
37 protected function getValueForControl() {
38 $value = parent::getValueForControl();
39 if ($value === true) {
40 return 'true';
42 if ($value === false) {
43 return 'false';
45 return null;
48 protected function newConduitParameterType() {
49 return new ConduitBoolParameterType();