Skip to content

Commit

Permalink
monitoring: Rearrange code in the HostcommentQuery
Browse files Browse the repository at this point in the history
refs #9956
  • Loading branch information
lippserd committed Sep 29, 2015
1 parent 2ce63ad commit b5561a8
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class HostcommentQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'comments' => array(
'comment_author' => 'c.author_name COLLATE latin1_general_ci',
'comment_author_name' => 'c.author_name',
Expand All @@ -55,6 +52,9 @@ class HostcommentQuery extends IdoQuery
'hoststatus' => array(
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
),
'instances' => array(
'instance_name' => 'i.instance_name'
),
'servicegroups' => array(
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
'servicegroup_name' => 'sgo.name1',
Expand Down Expand Up @@ -127,6 +127,18 @@ protected function joinHoststatus()
);
}

/**
* 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 @@ -163,16 +175,4 @@ protected function joinServices()
array()
);
}

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

0 comments on commit b5561a8

Please sign in to comment.