2015-12-08 16:54:01 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorHandlesEditField
|
|
|
|
extends PhabricatorPHIDListEditField {
|
|
|
|
|
2015-12-09 01:30:49 +01:00
|
|
|
private $handleParameterType;
|
|
|
|
private $isInvisible;
|
|
|
|
|
|
|
|
public function setHandleParameterType(AphrontHTTPParameterType $type) {
|
|
|
|
$this->handleParameterType = $type;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHandleParameterType() {
|
|
|
|
return $this->handleParameterType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setIsInvisible($is_invisible) {
|
|
|
|
$this->isInvisible = $is_invisible;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getIsInvisible() {
|
|
|
|
return $this->isInvisible;
|
|
|
|
}
|
|
|
|
|
2015-12-08 16:54:01 +01:00
|
|
|
protected function newControl() {
|
2015-12-09 01:30:49 +01:00
|
|
|
$control = id(new AphrontFormHandlesControl());
|
|
|
|
|
|
|
|
if ($this->getIsInvisible()) {
|
|
|
|
$control->setIsInvisible(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $control;
|
2015-12-08 16:54:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function newHTTPParameterType() {
|
2015-12-09 01:30:49 +01:00
|
|
|
$type = $this->getHandleParameterType();
|
|
|
|
|
|
|
|
if ($type) {
|
|
|
|
return $type;
|
|
|
|
}
|
|
|
|
|
|
|
|
return new AphrontPHIDListHTTPParameterType();
|
2015-12-08 16:54:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|