From 2ce63ad67dc1a3fb671bb06fb7b9c3883f792ba5 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 29 Sep 2015 22:22:32 +0200 Subject: [PATCH] monitoring: Remove HostcommentQuery::getGroup() refs #9956 --- .../Backend/Ido/Query/HostcommentQuery.php | 34 ++++++------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommentQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommentQuery.php index 2b06a00ef..756126ca8 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommentQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommentQuery.php @@ -13,6 +13,16 @@ class HostcommentQuery extends IdoQuery */ protected $allowCustomVars = true; + /** + * {@inheritdoc} + */ + protected $groupBase = array('comments' => array('c.comment_id', 'ho.object_id')); + + /** + * {@inheritdoc} + */ + protected $groupOrigin = array('hostgroups', 'services'); + /** * {@inheritdoc} */ @@ -165,28 +175,4 @@ class HostcommentQuery extends IdoQuery array() ); } - - /** - * {@inheritdoc} - */ - public function getGroup() - { - $group = array(); - if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('services')) { - $group = array('c.comment_id', 'ho.object_id'); - if ($this->hasJoinedVirtualTable('hosts')) { - $group[] = 'h.host_id'; - } - - if ($this->hasJoinedVirtualTable('hoststatus')) { - $group[] = 'hs.hoststatus_id'; - } - - if ($this->hasJoinedVirtualTable('instances')) { - $group[] = 'i.instance_id'; - } - } - - return $group; - } }