monitoring: Rearrange code in the ContactgroupQuery

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

View File

@ -27,9 +27,6 @@ class ContactgroupQuery extends IdoQuery
* {@inheritdoc} * {@inheritdoc}
*/ */
protected $columnMap = array( protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'contactgroups' => array( 'contactgroups' => array(
'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci', 'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci',
'contactgroup_name' => 'cgo.name1', 'contactgroup_name' => 'cgo.name1',
@ -69,6 +66,9 @@ class ContactgroupQuery 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',
@ -159,6 +159,18 @@ class ContactgroupQuery extends IdoQuery
); );
} }
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = cg.instance_id',
array()
);
}
/** /**
* Join service groups * Join service groups
*/ */
@ -199,16 +211,4 @@ class ContactgroupQuery extends IdoQuery
array() array()
); );
} }
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = cg.instance_id',
array()
);
}
} }