diff --git a/library/Icingadb/Model/DependencyNode.php b/library/Icingadb/Model/DependencyNode.php index 79a244bc9..c30677ad3 100644 --- a/library/Icingadb/Model/DependencyNode.php +++ b/library/Icingadb/Model/DependencyNode.php @@ -57,7 +57,9 @@ public function createBehaviors(Behaviors $behaviors): void ])); $behaviors->add(new ReRoute([ 'child' => 'to.from', - 'parent' => 'from.to' + 'parent' => 'from.to', + 'hostgroup' => 'host.hostgroup', + 'servicegroup' => 'service.servicegroup' ])); } diff --git a/library/Icingadb/Model/Host.php b/library/Icingadb/Model/Host.php index 05c35bc07..26e14287b 100644 --- a/library/Icingadb/Model/Host.php +++ b/library/Icingadb/Model/Host.php @@ -275,6 +275,7 @@ public function createRelations(Relations $relations) $relations->hasMany('notification', Notification::class)->setJoinType('LEFT'); $relations->hasMany('notification_history', NotificationHistory::class); $relations->hasMany('service', Service::class)->setJoinType('LEFT'); + $relations->hasOne('dependency_node', DependencyNode::class)->setJoinType('LEFT'); $relations->belongsToMany('from', DependencyEdge::class) ->setTargetCandidateKey('from_node_id') diff --git a/library/Icingadb/Model/RedundancyGroup.php b/library/Icingadb/Model/RedundancyGroup.php index d4e20140d..2965f0634 100644 --- a/library/Icingadb/Model/RedundancyGroup.php +++ b/library/Icingadb/Model/RedundancyGroup.php @@ -61,6 +61,7 @@ public function createRelations(Relations $relations): void ->setJoinType('LEFT'); $relations->hasMany('dependency', Dependency::class); + $relations->hasOne('dependency_node', DependencyNode::class)->setJoinType('LEFT'); $relations->belongsToMany('from', DependencyEdge::class) ->setTargetCandidateKey('from_node_id') diff --git a/library/Icingadb/Model/Service.php b/library/Icingadb/Model/Service.php index d895789ec..1568a0574 100644 --- a/library/Icingadb/Model/Service.php +++ b/library/Icingadb/Model/Service.php @@ -267,6 +267,7 @@ public function createRelations(Relations $relations) $relations->hasMany('history', History::class); $relations->hasMany('notification', Notification::class)->setJoinType('LEFT'); $relations->hasMany('notification_history', NotificationHistory::class); + $relations->hasOne('dependency_node', DependencyNode::class)->setJoinType('LEFT'); $relations->belongsToMany('from', DependencyEdge::class) ->setTargetCandidateKey('from_node_id')