mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 17:52:43 +01:00
cdef3e8bc8
Summary: Ref T8441. Ref T7715. - Update FileSearchEngine. - Nothing too special/fancy. Test Plan: - Searched for various files. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7715, T8441 Differential Revision: https://secure.phabricator.com/D13175
48 lines
939 B
PHP
48 lines
939 B
PHP
<?php
|
|
|
|
final class PhabricatorSearchThreeStateField
|
|
extends PhabricatorSearchField {
|
|
|
|
private $options;
|
|
|
|
public function setOptions($null, $yes, $no) {
|
|
$this->options = array(
|
|
'' => $null,
|
|
'true' => $yes,
|
|
'false' => $no,
|
|
);
|
|
return $this;
|
|
}
|
|
|
|
public function getOptions() {
|
|
return $this->options;
|
|
}
|
|
|
|
protected function getDefaultValue() {
|
|
return null;
|
|
}
|
|
|
|
protected function getValueFromRequest(AphrontRequest $request, $key) {
|
|
if (!strlen($request->getStr($key))) {
|
|
return null;
|
|
}
|
|
return $request->getBool($key);
|
|
}
|
|
|
|
protected function newControl() {
|
|
return id(new AphrontFormSelectControl())
|
|
->setOptions($this->getOptions());
|
|
}
|
|
|
|
protected function getValueForControl() {
|
|
$value = parent::getValueForControl();
|
|
if ($value === true) {
|
|
return 'true';
|
|
}
|
|
if ($value === false) {
|
|
return 'false';
|
|
}
|
|
return null;
|
|
}
|
|
|
|
}
|