CommentQuery: Add query column `instance_name'

refs #9943
This commit is contained in:
Johannes Meyer 2015-08-25 16:31:39 +02:00
parent 6ab61ba8e0
commit 91fe6913d8
4 changed files with 33 additions and 1 deletions

View File

@ -25,7 +25,8 @@ class CommentQuery extends IdoQuery
'comment_is_persistent' => 'c.comment_is_persistent',
'comment_timestamp' => 'c.comment_timestamp',
'comment_type' => 'c.comment_type',
'object_type' => 'c.object_type'
'object_type' => 'c.object_type',
'instance_name' => 'c.instance_name'
),
'hosts' => array(
'host_display_name' => 'c.host_display_name',

View File

@ -17,6 +17,9 @@ class HostcommentQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'comments' => array(
'comment_author' => 'c.author_name COLLATE latin1_general_ci',
'comment_author_name' => 'c.author_name',
@ -151,6 +154,18 @@ class HostcommentQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = c.instance_id',
array()
);
}
/**
* {@inheritdoc}
*/

View File

@ -17,6 +17,9 @@ class ServicecommentQuery extends IdoQuery
* {@inheritdoc}
*/
protected $columnMap = array(
'instances' => array(
'instance_name' => 'i.instance_name'
),
'comments' => array(
'comment_author' => 'c.author_name COLLATE latin1_general_ci',
'comment_author_name' => 'c.author_name',
@ -165,6 +168,18 @@ class ServicecommentQuery extends IdoQuery
);
}
/**
* Join instances
*/
protected function joinInstances()
{
$this->select->join(
array('i' => $this->prefix . 'instances'),
'i.instance_id = c.instance_id',
array()
);
}
/**
* {@inheritdoc}
*/

View File

@ -14,6 +14,7 @@ class Comment extends DataView
public function getColumns()
{
return array(
'instance_name',
'comment_author_name',
'comment_data',
'comment_expiration',