Skip to content

Commit

Permalink
HostcommenthistoryQuery: PostgreSQL grouping...
Browse files Browse the repository at this point in the history
refs #9009
  • Loading branch information
Johannes Meyer committed Jun 18, 2015
1 parent b56114c commit f20193e
Showing 1 changed file with 16 additions and 2 deletions.
Expand Up @@ -98,7 +98,6 @@ protected function joinHostgroups()
'hgo.object_id = hg.hostgroup_object_id AND hgo.is_active = 1 AND hgo.objecttype_id = 3',
array()
);
$this->select->group(array('hch.commenthistory_id', 'ho.name1'));
}

/**
Expand Down Expand Up @@ -148,6 +147,21 @@ protected function joinServices()
'so.object_id = s.service_object_id AND so.is_active = 1 AND so.objecttype_id = 2',
array()
);
$this->select->group(array('hch.commenthistory_id', 'ho.name1'));
}

/**
* {@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;
}
}

0 comments on commit f20193e

Please sign in to comment.