mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
parent
27f4fe82cd
commit
bdb73ec06e
@ -33,6 +33,11 @@ class HoststatehistoryQuery extends IdoQuery
|
|||||||
'hard_state' => 1
|
'hard_state' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected $subQueryTargets = array(
|
||||||
|
'hostgroups' => 'hostgroup',
|
||||||
|
'servicegroups' => 'servicegroup'
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@ -186,4 +191,19 @@ class HoststatehistoryQuery 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…
x
Reference in New Issue
Block a user