monitoring: Rearrange code in the ServicegroupQuery

refs #9956
This commit is contained in:
Eric Lippmann 2015-09-29 22:54:45 +02:00
parent e22dd1d0b4
commit df69755056
1 changed files with 15 additions and 15 deletions

View File

@ -24,9 +24,6 @@ class ServicegroupQuery 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',
@ -36,6 +33,9 @@ class ServicegroupQuery 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_alias' => 'sg.alias COLLATE latin1_general_ci', 'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci',
@ -102,6 +102,18 @@ class ServicegroupQuery extends IdoQuery
); );
} }
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = sg.instance_id',
array()
);
}
/** /**
* Join service objects * Join service objects
*/ */
@ -130,16 +142,4 @@ class ServicegroupQuery extends IdoQuery
array() array()
); );
} }
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = sg.instance_id',
array()
);
}
} }