parent
61d325fa8a
commit
c3d25e1a59
|
@ -14,6 +14,11 @@ class ServicegroupQuery extends IdoQuery
|
||||||
|
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
protected $subQueryTargets = array(
|
||||||
|
'hostgroups' => 'hostgroup',
|
||||||
|
'servicegroups' => 'servicegroup'
|
||||||
|
);
|
||||||
|
|
||||||
protected $columnMap = array(
|
protected $columnMap = array(
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup_name' => 'hgo.name1'
|
'hostgroup_name' => 'hgo.name1'
|
||||||
|
@ -178,4 +183,21 @@ class ServicegroupQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function joinSubQuery(IdoQuery $query, $name)
|
||||||
|
{
|
||||||
|
if ($name === 'hostgroup') {
|
||||||
|
$this->requireVirtualTable('members');
|
||||||
|
|
||||||
|
$query->joinVirtualTable('services');
|
||||||
|
|
||||||
|
return ['so.object_id', 'so.object_id'];
|
||||||
|
} elseif ($name === 'servicegroup') {
|
||||||
|
$query->joinVirtualTable('members');
|
||||||
|
|
||||||
|
return ['sgm.service_object_id', 'so.object_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::joinSubQuery($query, $name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue