monitoring: Rearrange code in the ServicecommentQuery

refs #9956
This commit is contained in:
Eric Lippmann 2015-09-29 22:42:44 +02:00
parent d2d960d072
commit 70717169c2
1 changed files with 15 additions and 15 deletions

View File

@ -27,9 +27,6 @@ class ServicecommentQuery extends IdoQuery
* {@inheritdoc} * {@inheritdoc}
*/ */
protected $columnMap = array( protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'comments' => array( 'comments' => array(
'comment_author' => 'c.author_name COLLATE latin1_general_ci', 'comment_author' => 'c.author_name COLLATE latin1_general_ci',
'comment_author_name' => 'c.author_name', 'comment_author_name' => 'c.author_name',
@ -56,6 +53,9 @@ class ServicecommentQuery extends IdoQuery
'host_alias' => 'h.alias', 'host_alias' => 'h.alias',
'host_display_name' => 'h.display_name COLLATE latin1_general_ci' 'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
), ),
'instances' => array(
'instance_name' => 'i.instance_name'
),
'hoststatus' => array( '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' 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END'
), ),
@ -154,6 +154,18 @@ class ServicecommentQuery extends IdoQuery
); );
} }
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = c.instance_id',
array()
);
}
/** /**
* Join services * Join services
*/ */
@ -177,16 +189,4 @@ class ServicecommentQuery extends IdoQuery
array() array()
); );
} }
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = c.instance_id',
array()
);
}
} }