parent
b5561a8306
commit
cd521891ae
|
@ -13,6 +13,16 @@ class HostcommenthistoryQuery extends IdoQuery
|
||||||
*/
|
*/
|
||||||
protected $allowCustomVars = true;
|
protected $allowCustomVars = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupBase = array('commenthistory' => array('hch.commenthistory_id', 'ho.object_id'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $groupOrigin = array('hostgroups', 'services');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@ -23,14 +33,12 @@ class HostcommenthistoryQuery extends IdoQuery
|
||||||
'commenthistory' => array(
|
'commenthistory' => array(
|
||||||
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
'host' => 'ho.name1 COLLATE latin1_general_ci',
|
||||||
'host_name' => 'ho.name1',
|
'host_name' => 'ho.name1',
|
||||||
'object_type' => '(\'host\')'
|
'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)",
|
||||||
'history' => array(
|
'timestamp' => 'UNIX_TIMESTAMP(hch.comment_time)',
|
||||||
'type' => "(CASE hch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)",
|
'object_id' => 'hch.object_id',
|
||||||
'timestamp' => 'UNIX_TIMESTAMP(hch.comment_time)',
|
'state' => '(-1)',
|
||||||
'object_id' => 'hch.object_id',
|
'output' => "('[' || hch.author_name || '] ' || hch.comment_data)",
|
||||||
'state' => '(-1)',
|
|
||||||
'output' => "('[' || hch.author_name || '] ' || hch.comment_data)",
|
|
||||||
),
|
),
|
||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
|
||||||
|
@ -80,7 +88,6 @@ class HostcommenthistoryQuery extends IdoQuery
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
$this->joinedVirtualTables['commenthistory'] = true;
|
$this->joinedVirtualTables['commenthistory'] = true;
|
||||||
$this->joinedVirtualTables['history'] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -163,20 +170,4 @@ class HostcommenthistoryQuery extends IdoQuery
|
||||||
array()
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue