You are here

protected function EntityResource::getCollectionCountQuery in JSON:API 8.2

Same name and namespace in other branches
  1. 8 src/Controller/EntityResource.php \Drupal\jsonapi\Controller\EntityResource::getCollectionCountQuery()

Gets a basic query for a collection count.

Parameters

\Drupal\jsonapi\ResourceType\ResourceType $resource_type: The base JSON:API resource type for the query.

array $params: The parameters for the query.

\Drupal\Core\Cache\CacheableMetadata $query_cacheability: Collects cacheability for the query.

Return value

\Drupal\Core\Entity\Query\QueryInterface A new query.

1 call to EntityResource::getCollectionCountQuery()
EntityResource::getCollection in src/Controller/EntityResource.php
Gets the collection of entities.

File

src/Controller/EntityResource.php, line 907

Class

EntityResource
Process all entity requests.

Namespace

Drupal\jsonapi\Controller

Code

protected function getCollectionCountQuery(ResourceType $resource_type, array $params, CacheableMetadata $query_cacheability) {

  // Reset the range to get all the available results.
  return $this
    ->getCollectionQuery($resource_type, $params, $query_cacheability)
    ->range()
    ->count();
}