mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
StatusQuery: Rename baseQuery to select
This commit is contained in:
parent
734c329caa
commit
eeadc17a6e
@ -303,10 +303,8 @@ class StatusQuery extends IdoQuery
|
|||||||
|
|
||||||
protected function joinBaseTables()
|
protected function joinBaseTables()
|
||||||
{
|
{
|
||||||
$this->baseQuery = $this->db->select()->from(
|
$this->select->from(array('ho' => $this->prefix . 'objects'), array())
|
||||||
array('ho' => $this->prefix . 'objects'),
|
->join(
|
||||||
array()
|
|
||||||
)->join(
|
|
||||||
array('hs' => $this->prefix . 'hoststatus'),
|
array('hs' => $this->prefix . 'hoststatus'),
|
||||||
'ho.object_id = hs.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
|
'ho.object_id = hs.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
|
||||||
array()
|
array()
|
||||||
@ -333,7 +331,7 @@ class StatusQuery extends IdoQuery
|
|||||||
|
|
||||||
protected function joinServices()
|
protected function joinServices()
|
||||||
{
|
{
|
||||||
$this->baseQuery->join(
|
$this->select->join(
|
||||||
array('s' => $this->prefix . 'services'),
|
array('s' => $this->prefix . 'services'),
|
||||||
's.host_object_id = h.host_object_id',
|
's.host_object_id = h.host_object_id',
|
||||||
array()
|
array()
|
||||||
@ -359,7 +357,7 @@ class StatusQuery extends IdoQuery
|
|||||||
|
|
||||||
protected function joinHostHostgroups()
|
protected function joinHostHostgroups()
|
||||||
{
|
{
|
||||||
$this->baseQuery->join(
|
$this->select->join(
|
||||||
array('hgm' => $this->prefix . 'hostgroup_members'),
|
array('hgm' => $this->prefix . 'hostgroup_members'),
|
||||||
'hgm.host_object_id = h.host_object_id',
|
'hgm.host_object_id = h.host_object_id',
|
||||||
array()
|
array()
|
||||||
@ -378,7 +376,7 @@ class StatusQuery extends IdoQuery
|
|||||||
|
|
||||||
protected function joinServiceHostgroups()
|
protected function joinServiceHostgroups()
|
||||||
{
|
{
|
||||||
$this->baseQuery->join(
|
$this->select->join(
|
||||||
array('hgm' => $this->prefix . 'hostgroup_members'),
|
array('hgm' => $this->prefix . 'hostgroup_members'),
|
||||||
'hgm.host_object_id = s.host_object_id',
|
'hgm.host_object_id = s.host_object_id',
|
||||||
array()
|
array()
|
||||||
@ -399,7 +397,7 @@ class StatusQuery extends IdoQuery
|
|||||||
protected function joinServicegroups()
|
protected function joinServicegroups()
|
||||||
{
|
{
|
||||||
$this->requireVirtualTable('services');
|
$this->requireVirtualTable('services');
|
||||||
$this->baseQuery->join(
|
$this->select->join(
|
||||||
array('sgm' => $this->prefix . 'servicegroup_members'),
|
array('sgm' => $this->prefix . 'servicegroup_members'),
|
||||||
'sgm.service_object_id = s.service_object_id',
|
'sgm.service_object_id = s.service_object_id',
|
||||||
array()
|
array()
|
||||||
@ -421,7 +419,7 @@ class StatusQuery extends IdoQuery
|
|||||||
// columns in a more efficient way
|
// columns in a more efficient way
|
||||||
protected function joinServiceproblemsummary()
|
protected function joinServiceproblemsummary()
|
||||||
{
|
{
|
||||||
$this->baseQuery->joinleft(
|
$this->select->joinleft(
|
||||||
array ('sps' => new \Zend_Db_Expr(
|
array ('sps' => new \Zend_Db_Expr(
|
||||||
'(SELECT COUNT(s.service_object_id) as unhandled_service_count, s.host_object_id as host_object_id '.
|
'(SELECT COUNT(s.service_object_id) as unhandled_service_count, s.host_object_id as host_object_id '.
|
||||||
'FROM icinga_services s INNER JOIN icinga_servicestatus ss ON ss.current_state != 0 AND '.
|
'FROM icinga_services s INNER JOIN icinga_servicestatus ss ON ss.current_state != 0 AND '.
|
||||||
@ -437,7 +435,7 @@ class StatusQuery extends IdoQuery
|
|||||||
// TODO: Terribly slow. As I have no idea of how to fix this we should remove it.
|
// TODO: Terribly slow. As I have no idea of how to fix this we should remove it.
|
||||||
protected function joinLasthostcomment()
|
protected function joinLasthostcomment()
|
||||||
{
|
{
|
||||||
$this->baseQuery->joinleft(
|
$this->select->joinleft(
|
||||||
array ('hlc' => new \Zend_Db_Expr(
|
array ('hlc' => new \Zend_Db_Expr(
|
||||||
'(SELECT MAX(c.comment_id) as comment_id, c.object_id '.
|
'(SELECT MAX(c.comment_id) as comment_id, c.object_id '.
|
||||||
'FROM icinga_comments c GROUP BY c.object_id)')
|
'FROM icinga_comments c GROUP BY c.object_id)')
|
||||||
@ -450,7 +448,7 @@ class StatusQuery extends IdoQuery
|
|||||||
// TODO: Terribly slow. As I have no idea of how to fix this we should remove it.
|
// TODO: Terribly slow. As I have no idea of how to fix this we should remove it.
|
||||||
protected function joinLastservicecomment()
|
protected function joinLastservicecomment()
|
||||||
{
|
{
|
||||||
$this->baseQuery->joinleft(
|
$this->select->joinleft(
|
||||||
array ('slc' => new \Zend_Db_Expr(
|
array ('slc' => new \Zend_Db_Expr(
|
||||||
'(SELECT MAX(c.comment_id) as comment_id, c.object_id '.
|
'(SELECT MAX(c.comment_id) as comment_id, c.object_id '.
|
||||||
'FROM icinga_comments c GROUP BY c.object_id)')
|
'FROM icinga_comments c GROUP BY c.object_id)')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user