IcingaObject: Add storeImports как то так

This commit is contained in:
Alexander Fuhr 2015-06-26 15:55:16 +02:00
parent 864b9ea55c
commit a663d571be

View File

@ -169,13 +169,13 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
public function onInsert()
{
$this->storeCustomVars()->storeGroups();
$this->storeCustomVars()->storeGroups()->storeImports();
DirectorActivityLog::logCreation($this, $this->connection);
}
public function onUpdate()
{
$this->storeCustomVars()->storeGroups();
$this->storeCustomVars()->storeGroups()->storeImports();
DirectorActivityLog::logModification($this, $this->connection);
}
@ -197,6 +197,15 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
return $this;
}
protected function storeImports()
{
if ($this->supportsImports()) {
$this->imports !== null && $this->imports()->store();
}
return $this;
}
public function onDelete()
{
DirectorActivityLog::logRemoval($this, $this->connection);