mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-26 11:19:16 +02:00
IcingaObject: allow to unset relations
This commit is contained in:
parent
7cdb44b1f9
commit
389fcf2fa6
@ -166,6 +166,10 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->hasRelation($key)) {
|
if ($this->hasRelation($key)) {
|
||||||
|
if (! $value) {
|
||||||
|
return parent::set($key . '_id', null);
|
||||||
|
}
|
||||||
|
|
||||||
$class = $this->getRelationClass($key);
|
$class = $this->getRelationClass($key);
|
||||||
$object = $class::load($value, $this->connection);
|
$object = $class::load($value, $this->connection);
|
||||||
if (in_array($object->object_type, array('object', 'external_object'))) {
|
if (in_array($object->object_type, array('object', 'external_object'))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user