public function Select::countQuery

Implements SelectInterface::countQuery().

Overrides SelectInterface::countQuery

File

drupal/core/lib/Drupal/Core/Database/Query/Select.php, line 589
Definition of Drupal\Core\Database\Query\Select

Class

Select
Query builder for SELECT statements.

Namespace

Drupal\Core\Database\Query

Code

public function countQuery() {
  $count = $this
    ->prepareCountQuery();
  $query = $this->connection
    ->select($count, NULL, $this->queryOptions);
  $query
    ->addExpression('COUNT(*)');
  return $query;
}