mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 00:34:05 +02:00
IcingaObjectGroup: re-enable group membership...
...resolver refs #2048
This commit is contained in:
parent
8cbde4a50e
commit
d429c9e5cc
@ -22,6 +22,8 @@ abstract class IcingaObjectGroup extends IcingaObject implements ExportInterface
|
|||||||
'assign_filter' => null,
|
'assign_filter' => null,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
protected $memberShipShouldBeRefreshed = false;
|
||||||
|
|
||||||
public function getUniqueIdentifier()
|
public function getUniqueIdentifier()
|
||||||
{
|
{
|
||||||
return $this->getObjectName();
|
return $this->getObjectName();
|
||||||
@ -32,24 +34,27 @@ abstract class IcingaObjectGroup extends IcingaObject implements ExportInterface
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function memberShipShouldBeRefreshed(): bool
|
protected function beforeStore()
|
||||||
{
|
{
|
||||||
|
parent::beforeStore();
|
||||||
if ($this->hasBeenLoadedFromDb()) {
|
if ($this->hasBeenLoadedFromDb()) {
|
||||||
if (!array_key_exists('assign_filter', $this->getModifiedProperties())) {
|
if (!array_key_exists('assign_filter', $this->getModifiedProperties())) {
|
||||||
return false;
|
$this->memberShipShouldBeRefreshed = false;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($this->get('assign_filter') === null) {
|
if ($this->get('assign_filter') === null) {
|
||||||
return false;
|
$this->memberShipShouldBeRefreshed = false;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
$this->memberShipShouldBeRefreshed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function notifyResolvers()
|
protected function notifyResolvers()
|
||||||
{
|
{
|
||||||
if ($this->memberShipShouldBeRefreshed()) {
|
if ($this->memberShipShouldBeRefreshed) {
|
||||||
$resolver = $this->getMemberShipResolver();
|
$resolver = $this->getMemberShipResolver();
|
||||||
$resolver->addGroup($this);
|
$resolver->addGroup($this);
|
||||||
$resolver->refreshDb();
|
$resolver->refreshDb();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user