Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorConfigOption.php
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | public function setType($type) { | ||||
$this->type = $type; | $this->type = $type; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getType() { | public function getType() { | ||||
return $this->type; | return $this->type; | ||||
} | } | ||||
public function newOptionType() { | |||||
$type_key = $this->getType(); | |||||
$type_map = PhabricatorConfigType::getAllTypes(); | |||||
return idx($type_map, $type_key); | |||||
} | |||||
public function isCustomType() { | public function isCustomType() { | ||||
return !strncmp($this->getType(), 'custom:', 7); | return !strncmp($this->getType(), 'custom:', 7); | ||||
} | } | ||||
public function getCustomObject() { | public function getCustomObject() { | ||||
if (!$this->customObject) { | if (!$this->customObject) { | ||||
if (!$this->isCustomType()) { | if (!$this->isCustomType()) { | ||||
throw new Exception(pht('This option does not have a custom type!')); | throw new Exception(pht('This option does not have a custom type!')); | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |