mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-26 03:09:11 +02:00
IcingaObjectImports: Fix bug with on delete
This commit is contained in:
parent
114bac0d55
commit
321f9d9503
@ -93,6 +93,10 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count($new) === 0) {
|
||||||
|
return $this->clear();
|
||||||
|
}
|
||||||
|
|
||||||
$this->imports = array();
|
$this->imports = array();
|
||||||
return $this->add($import);
|
return $this->add($import);
|
||||||
}
|
}
|
||||||
@ -107,6 +111,16 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer
|
|||||||
return array_key_exists($import, $this->imports);
|
return array_key_exists($import, $this->imports);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function clear()
|
||||||
|
{
|
||||||
|
$this->imports = array();
|
||||||
|
|
||||||
|
$this->modified = true;
|
||||||
|
$this->refreshIndex();
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function remove($import)
|
public function remove($import)
|
||||||
{
|
{
|
||||||
if (array_key_exists($import, $this->imports)) {
|
if (array_key_exists($import, $this->imports)) {
|
||||||
@ -115,6 +129,8 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer
|
|||||||
|
|
||||||
$this->modified = true;
|
$this->modified = true;
|
||||||
$this->refreshIndex();
|
$this->refreshIndex();
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function refreshIndex()
|
protected function refreshIndex()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user