You are here

protected static function TemporaryQueryGuard::alwaysFalse in JSON:API 8

Same name and namespace in other branches
  1. 8.2 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 src/Access/TemporaryQueryGuard.php
Gets an access condition for the allowed JSONAPI_FILTER_AMONG_* subsets.
TemporaryQueryGuard::getCommentAccessCondition in src/Access/TemporaryQueryGuard.php
Gets an access condition for a comment entity.

File

src/Access/TemporaryQueryGuard.php, line 565

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, '>'),
  ]);
}