monitoring: Rearrange code in the HoststatehistoryQuery

refs #9956
This commit is contained in:
Eric Lippmann 2015-09-30 09:25:44 +02:00
parent 178ebd215d
commit bbd59d4fbc
1 changed files with 15 additions and 15 deletions

View File

@ -37,9 +37,6 @@ class HoststatehistoryQuery extends IdoQuery
* {@inheritdoc} * {@inheritdoc}
*/ */
protected $columnMap = array( protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'hostgroups' => array( 'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci', 'hostgroup_alias' => 'hg.alias COLLATE latin1_general_ci',
@ -49,6 +46,9 @@ class HoststatehistoryQuery 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'
),
'servicegroups' => array( 'servicegroups' => array(
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
'servicegroup_name' => 'sgo.name1', 'servicegroup_name' => 'sgo.name1',
@ -138,6 +138,18 @@ class HoststatehistoryQuery extends IdoQuery
); );
} }
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = hh.instance_id',
array()
);
}
/** /**
* Join service groups * Join service groups
*/ */
@ -174,16 +186,4 @@ class HoststatehistoryQuery extends IdoQuery
array() array()
); );
} }
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = hh.instance_id',
array()
);
}
} }