Get the equivalent COUNT query of this query as a new query object.
Drupal\Core\Database\Query\SelectInterface A new SelectQuery object with no fields or expressions besides COUNT(*).
Overrides SelectInterface::countQuery
public function countQuery() {
return $this->query
->countQuery();
}