Use subquery filters for host downtime history if appropriate
refs #2934
This commit is contained in:
parent
81b6b0129b
commit
0ca97d191f
|
@ -23,6 +23,11 @@ class HostdowntimestarthistoryQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $groupOrigin = array('hostgroups', 'services');
|
protected $groupOrigin = array('hostgroups', 'services');
|
||||||
|
|
||||||
|
protected $subQueryTargets = array(
|
||||||
|
'hostgroups' => 'hostgroup',
|
||||||
|
'servicegroups' => 'servicegroup'
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@ -180,4 +185,19 @@ class HostdowntimestarthistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function joinSubQuery(IdoQuery $query, $name)
|
||||||
|
{
|
||||||
|
if ($name === 'hostgroup') {
|
||||||
|
$query->joinVirtualTable('members');
|
||||||
|
|
||||||
|
return ['hgm.host_object_id', 'ho.object_id'];
|
||||||
|
} elseif ($name === 'servicegroup') {
|
||||||
|
$query->joinVirtualTable('services');
|
||||||
|
|
||||||
|
return ['s.host_object_id', 'ho.object_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::joinSubQuery($query, $name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue