Overrides SelectionBase::buildEntityQuery().
Overrides SelectionBase::buildEntityQuery
public function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
$query = parent::buildEntityQuery($match, $match_operator);
// Adding the 'comment_access' tag is sadly insufficient for comments:
// core requires us to also know about the concept of 'published' and
// 'unpublished'.
if (!user_access('administer comments')) {
$query
->condition('status', COMMENT_PUBLISHED);
}
return $query;
}