You are here

protected function EntityQueryResourceBase::getEntityQuery in JSON:API Resources 8

Gets an entity query for the given entity type.

Parameters

string $entity_type_id: The entity type ID for the entity query.

Return value

\Drupal\Core\Entity\Query\QueryInterface An entity query.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/Resource/EntityQueryResourceBase.php, line 48

Class

EntityQueryResourceBase
Defines basic functionality for an entity query-oriented JSON:API Resource.

Namespace

Drupal\jsonapi_resources\Resource

Code

protected function getEntityQuery($entity_type_id) {
  return $this->entityTypeManager
    ->getStorage($entity_type_id)
    ->getQuery();
}