HostgroupQuery: Add query column `instance_name'

refs #9943
This commit is contained in:
Johannes Meyer 2015-08-25 16:34:37 +02:00
parent f70a861ff4
commit fedd2c3b18
2 changed files with 16 additions and 0 deletions

View File

@ -17,6 +17,9 @@ 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',
@ -126,6 +129,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()
);
}
/**
* {@inheritdoc}
*/

View File

@ -14,6 +14,7 @@ class Hostgroup extends DataView
public function getColumns()
{
return array(
'instance_name',
'hostgroup_alias',
'hostgroup_name'
);