From 956c86dcdb103d3753e0ffae4da3920c52a1639c Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 29 Sep 2015 23:03:13 +0200 Subject: [PATCH] monitoring: Remove HostdowntimestarthistoryQuery::getGroup() refs #9956 --- .../Query/HostdowntimestarthistoryQuery.php | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php index 9813259b0..feb5da42c 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php @@ -13,6 +13,16 @@ class HostdowntimestarthistoryQuery extends IdoQuery */ protected $allowCustomVars = true; + /** + * {@inheritdoc} + */ + protected $groupBase = array('downtimehistory' => array('hdh.downtimehistory_id', 'ho.object_id')); + + /** + * {@inheritdoc} + */ + protected $groupOrigin = array('hostgroups', 'services'); + /** * {@inheritdoc} */ @@ -23,14 +33,12 @@ class HostdowntimestarthistoryQuery extends IdoQuery 'downtimehistory' => array( 'host' => 'ho.name1 COLLATE latin1_general_ci', 'host_name' => 'ho.name1', - 'object_type' => '(\'host\')' - ), - 'history' => array( - 'type' => "('dt_start')", - 'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)', - 'object_id' => 'hdh.object_id', - 'state' => '(-1)', - 'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)", + 'object_id' => 'hdh.object_id', + 'object_type' => '(\'host\')', + 'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)", + 'state' => '(-1)', + 'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)', + 'type' => "('dt_start')" ), 'hostgroups' => array( 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', @@ -172,20 +180,4 @@ class HostdowntimestarthistoryQuery extends IdoQuery array() ); } - - /** - * {@inheritdoc} - */ - public function getGroup() - { - $group = array(); - if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('services')) { - $group = array('hdh.downtimehistory_id', 'ho.object_id'); - if ($this->hasJoinedVirtualTable('hosts')) { - $group[] = 'h.host_id'; - } - } - - return $group; - } }