mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
parent
a3ec0df7c5
commit
61d325fa8a
@ -18,6 +18,11 @@ class HostgroupQuery extends IdoQuery
|
|||||||
|
|
||||||
protected $groupOrigin = array('members');
|
protected $groupOrigin = array('members');
|
||||||
|
|
||||||
|
protected $subQueryTargets = array(
|
||||||
|
'hostgroups' => 'hostgroup',
|
||||||
|
'servicegroups' => 'servicegroup'
|
||||||
|
);
|
||||||
|
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
@ -223,4 +228,23 @@ class HostgroupQuery extends IdoQuery
|
|||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function joinSubQuery(IdoQuery $query, $name)
|
||||||
|
{
|
||||||
|
if ($name === 'hostgroup') {
|
||||||
|
$this->requireVirtualTable('members');
|
||||||
|
|
||||||
|
$query->joinVirtualTable('members');
|
||||||
|
|
||||||
|
return ['hgm.host_object_id', 'ho.object_id'];
|
||||||
|
} elseif ($name === 'servicegroup') {
|
||||||
|
$this->requireVirtualTable('members');
|
||||||
|
|
||||||
|
$query->joinVirtualTable('services');
|
||||||
|
|
||||||
|
return ['s.host_object_id', 'ho.object_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::joinSubQuery($query, $name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user