Skip to content

Commit

Permalink
monitoring: Rearrange code in the ContactQuery
Browse files Browse the repository at this point in the history
refs #9956
  • Loading branch information
lippserd committed Sep 29, 2015
1 parent e110649 commit 0221559
Showing 1 changed file with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,6 @@ protected function joinBaseTables()
$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
*/
Expand Down Expand Up @@ -155,6 +138,18 @@ protected function joinHosts()
);
}

/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = c.instance_id',
array()
);
}

/**
* Join service groups
*/
Expand Down Expand Up @@ -197,13 +192,18 @@ protected function joinServices()
}

/**
* 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()
);
}
Expand Down

0 comments on commit 0221559

Please sign in to comment.