mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-12 00:26:13 +01:00
26 lines
497 B
PHP
26 lines
497 B
PHP
|
<?php
|
||
|
|
||
|
final class PhabricatorSelectEditField
|
||
|
extends PhabricatorEditField {
|
||
|
|
||
|
private $options;
|
||
|
|
||
|
public function setOptions(array $options) {
|
||
|
$this->options = $options;
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function getOptions() {
|
||
|
if ($this->options === null) {
|
||
|
throw new PhutilInvalidStateException('setOptions');
|
||
|
}
|
||
|
return $this->options;
|
||
|
}
|
||
|
|
||
|
protected function newControl() {
|
||
|
return id(new AphrontFormSelectControl())
|
||
|
->setOptions($this->getOptions());
|
||
|
}
|
||
|
|
||
|
}
|