parent
a3ec0df7c5
commit
61d325fa8a
|
@ -18,6 +18,11 @@ class HostgroupQuery extends IdoQuery
|
|||
|
||||
protected $groupOrigin = array('members');
|
||||
|
||||
protected $subQueryTargets = array(
|
||||
'hostgroups' => 'hostgroup',
|
||||
'servicegroups' => 'servicegroup'
|
||||
);
|
||||
|
||||
protected $columnMap = array(
|
||||
'hostgroups' => array(
|
||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||
|
@ -223,4 +228,23 @@ class HostgroupQuery extends IdoQuery
|
|||
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…
Reference in New Issue