diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php index 8e3b864d5..d6554da04 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php @@ -97,23 +97,6 @@ class ContactQuery extends IdoQuery $this->joinedVirtualTables['contacts'] = true; } - /** - * Join timeperiods - */ - protected function joinTimeperiods() - { - $this->select->joinLeft( - array('ht' => $this->prefix . 'timeperiods'), - 'ht.timeperiod_object_id = c.host_timeperiod_object_id', - array() - ); - $this->select->joinLeft( - array('st' => $this->prefix . 'timeperiods'), - 'st.timeperiod_object_id = c.service_timeperiod_object_id', - array() - ); - } - /** * Join host groups */ @@ -155,6 +138,18 @@ class ContactQuery extends IdoQuery ); } + /** + * Join instances + */ + protected function joinInstances() + { + $this->select->join( + array('i' => $this->prefix . 'instances'), + 'i.instance_id = c.instance_id', + array() + ); + } + /** * Join service groups */ @@ -197,13 +192,18 @@ class ContactQuery extends IdoQuery } /** - * Join instances + * Join time periods */ - protected function joinInstances() + protected function joinTimeperiods() { - $this->select->join( - array('i' => $this->prefix . 'instances'), - 'i.instance_id = c.instance_id', + $this->select->joinLeft( + array('ht' => $this->prefix . 'timeperiods'), + 'ht.timeperiod_object_id = c.host_timeperiod_object_id', + array() + ); + $this->select->joinLeft( + array('st' => $this->prefix . 'timeperiods'), + 'st.timeperiod_object_id = c.service_timeperiod_object_id', array() ); }