function Query::getComments

Same name in other branches
  1. 7.x includes/database/query.inc \Query::getComments()
  2. 9 core/lib/Drupal/Core/Database/Query/Query.php \Drupal\Core\Database\Query\Query::getComments()
  3. 8.9.x core/lib/Drupal/Core/Database/Query/Query.php \Drupal\Core\Database\Query\Query::getComments()
  4. 10 core/lib/Drupal/Core/Database/Query/Query.php \Drupal\Core\Database\Query\Query::getComments()

Returns a reference to the comments array for the query.

Because this method returns by reference, alter hooks may edit the comments array directly to make their changes. If just adding comments, however, the use of comment() is preferred.

Note that this method must be called by reference as well:

$comments =& $query->getComments();

Return value

array A reference to the comments array structure.

File

core/lib/Drupal/Core/Database/Query/Query.php, line 182

Class

Query
Base class for query builders.

Namespace

Drupal\Core\Database\Query

Code

public function &getComments() {
    return $this->comments;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.