monitoring: Rearrange code in the HostgroupQuery

refs #9956
This commit is contained in:
Eric Lippmann 2015-09-29 22:50:49 +02:00
parent 6519b25ec1
commit 73152e9244
1 changed files with 15 additions and 15 deletions

View File

@ -27,9 +27,6 @@ class HostgroupQuery 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',
@ -43,6 +40,9 @@ class HostgroupQuery 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_alias' => 'sg.alias COLLATE latin1_general_ci',
@ -101,6 +101,18 @@ class HostgroupQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = hg.instance_id',
array()
);
}
/**
* Join service groups
*/
@ -138,16 +150,4 @@ class HostgroupQuery extends IdoQuery
array()
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = hg.instance_id',
array()
);
}
}