monitoring: Remove HostcommenthistoryQuery::getGroup()

refs #9956
This commit is contained in:
Eric Lippmann 2015-09-29 22:25:02 +02:00
parent b5561a8306
commit cd521891ae
1 changed files with 16 additions and 25 deletions

View File

@ -13,6 +13,16 @@ class HostcommenthistoryQuery extends IdoQuery
*/
protected $allowCustomVars = true;
/**
* {@inheritdoc}
*/
protected $groupBase = array('commenthistory' => array('hch.commenthistory_id', 'ho.object_id'));
/**
* {@inheritdoc}
*/
protected $groupOrigin = array('hostgroups', 'services');
/**
* {@inheritdoc}
*/
@ -23,14 +33,12 @@ class HostcommenthistoryQuery extends IdoQuery
'commenthistory' => array(
'host' => 'ho.name1 COLLATE latin1_general_ci',
'host_name' => 'ho.name1',
'object_type' => '(\'host\')'
),
'history' => array(
'type' => "(CASE hch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)",
'timestamp' => 'UNIX_TIMESTAMP(hch.comment_time)',
'object_id' => 'hch.object_id',
'state' => '(-1)',
'output' => "('[' || hch.author_name || '] ' || hch.comment_data)",
'object_type' => '(\'host\')',
'type' => "(CASE hch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)",
'timestamp' => 'UNIX_TIMESTAMP(hch.comment_time)',
'object_id' => 'hch.object_id',
'state' => '(-1)',
'output' => "('[' || hch.author_name || '] ' || hch.comment_data)",
),
'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
@ -80,7 +88,6 @@ class HostcommenthistoryQuery extends IdoQuery
array()
);
$this->joinedVirtualTables['commenthistory'] = true;
$this->joinedVirtualTables['history'] = true;
}
/**
@ -163,20 +170,4 @@ class HostcommenthistoryQuery extends IdoQuery
array()
);
}
/**
* {@inheritdoc}
*/
public function getGroup()
{
$group = array();
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('services')) {
$group = array('hch.commenthistory_id', 'ho.object_id');
if ($this->hasJoinedVirtualTable('hosts')) {
$group[] = 'h.host_id';
}
}
return $group;
}
}