mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
DirectorObjectForm: use new inheritance helpers
This commit is contained in:
parent
a4e6d3251a
commit
f65275bda7
@ -175,7 +175,7 @@ abstract class DirectorObjectForm extends DirectorForm
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$object->templateResolver()->listResolvedParentIds();
|
$object->listAncestorIds();
|
||||||
} catch (NestingError $e) {
|
} catch (NestingError $e) {
|
||||||
$this->addUniqueErrorMessage($e->getMessage());
|
$this->addUniqueErrorMessage($e->getMessage());
|
||||||
return $this->resolvedImports = false;
|
return $this->resolvedImports = false;
|
||||||
@ -602,11 +602,13 @@ abstract class DirectorObjectForm extends DirectorForm
|
|||||||
return $this->object !== null;
|
return $this->object !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setObject(IcingaObject $object)
|
public function setObject(DbObject $object)
|
||||||
{
|
{
|
||||||
$this->object = $object;
|
$this->object = $object;
|
||||||
if ($this->db === null) {
|
if ($this->db === null) {
|
||||||
$this->setDb($object->getConnection());
|
/** @var Db $connection */
|
||||||
|
$connection = $object->getConnection();
|
||||||
|
$this->setDb($connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -1037,7 +1039,7 @@ abstract class DirectorObjectForm extends DirectorForm
|
|||||||
|
|
||||||
protected function addChoiceElement(IcingaTemplateChoice $choice)
|
protected function addChoiceElement(IcingaTemplateChoice $choice)
|
||||||
{
|
{
|
||||||
$imports = $this->object()->get('imports');
|
$imports = $this->object()->listImportNames();
|
||||||
$element = $choice->createFormElement($this, $imports);
|
$element = $choice->createFormElement($this, $imports);
|
||||||
$this->addElement($element);
|
$this->addElement($element);
|
||||||
$this->choiceElements[$element->getName()] = $element;
|
$this->choiceElements[$element->getName()] = $element;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user