From d2d960d072d87f72c1196f76d8afabec506ecd64 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 29 Sep 2015 22:42:00 +0200 Subject: [PATCH] monitoring: Remove ServicecommentQuery::getGroup() refs #9956 --- .../Backend/Ido/Query/ServicecommentQuery.php | 42 +++++-------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommentQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommentQuery.php index dea7554ba..70e7bda36 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommentQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommentQuery.php @@ -13,6 +13,16 @@ class ServicecommentQuery extends IdoQuery */ protected $allowCustomVars = true; + /** + * {@inheritdoc} + */ + protected $groupBase = array('comments' => array('c.comment_id', 'so.object_id')); + + /** + * {@inheritdoc} + */ + protected $groupOrigin = array('hostgroups', 'servicegroups'); + /** * {@inheritdoc} */ @@ -179,36 +189,4 @@ class ServicecommentQuery extends IdoQuery array() ); } - - /** - * {@inheritdoc} - */ - public function getGroup() - { - $group = array(); - if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('servicegroups')) { - $group = array('c.comment_id', 'so.object_id'); - if ($this->hasJoinedVirtualTable('hosts')) { - $group[] = 'h.host_id'; - } - - if ($this->hasJoinedVirtualTable('services')) { - $group[] = 's.service_id'; - } - - if ($this->hasJoinedVirtualTable('hoststatus')) { - $group[] = 'hs.hoststatus_id'; - } - - if ($this->hasJoinedVirtualTable('servicestatus')) { - $group[] = 'ss.servicestatus_id'; - } - - if ($this->hasJoinedVirtualTable('instances')) { - $group[] = 'i.instance_id'; - } - } - - return $group; - } }