monitoring: Rearrange code in the ServicestatushistoryQuery

refs #9956
This commit is contained in:
Eric Lippmann 2015-09-30 09:28:27 +02:00
parent e96d0c26e3
commit 690fc89d62
1 changed files with 15 additions and 15 deletions

View File

@ -37,9 +37,6 @@ class ServicestatehistoryQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
@ -49,6 +46,9 @@ class ServicestatehistoryQuery extends IdoQuery
'host_alias' => 'h.alias',
'host_display_name' => 'h.display_name COLLATE latin1_general_ci'
),
'instances' => array(
'instance_name' => 'i.instance_name'
),
'servicegroups' => array(
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
'servicegroup_name' => 'sgo.name1',
@ -141,6 +141,18 @@ class ServicestatehistoryQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = sh.instance_id',
array()
);
}
/**
* Join service groups
*/
@ -172,16 +184,4 @@ class ServicestatehistoryQuery extends IdoQuery
array()
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = sh.instance_id',
array()
);
}
}