You are here

protected static function TemporaryQueryGuard::alwaysFalse in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/src/Access/TemporaryQueryGuard.php \Drupal\jsonapi\Access\TemporaryQueryGuard::alwaysFalse()

Gets an always FALSE entity condition group for the given entity type.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type for which to construct an impossible condition.

Return value

\Drupal\jsonapi\Query\EntityConditionGroup An EntityConditionGroup which cannot evaluate to TRUE.

2 calls to TemporaryQueryGuard::alwaysFalse()
TemporaryQueryGuard::getAccessConditionForKnownSubsets in core/modules/jsonapi/src/Access/TemporaryQueryGuard.php
Gets an access condition for the allowed JSONAPI_FILTER_AMONG_* subsets.
TemporaryQueryGuard::getCommentAccessCondition in core/modules/jsonapi/src/Access/TemporaryQueryGuard.php
Gets an access condition for a comment entity.

File

core/modules/jsonapi/src/Access/TemporaryQueryGuard.php, line 547

Class

TemporaryQueryGuard
Adds sufficient access control to collection queries.

Namespace

Drupal\jsonapi\Access

Code

protected static function alwaysFalse(EntityTypeInterface $entity_type) {
  return new EntityConditionGroup('AND', [
    new EntityCondition($entity_type
      ->getKey('id'), 1, '<'),
    new EntityCondition($entity_type
      ->getKey('id'), 1, '>'),
  ]);
}