function TemporaryQueryGuard::alwaysFalse

Same name in other branches
  1. 8.9.x core/modules/jsonapi/src/Access/TemporaryQueryGuard.php \Drupal\jsonapi\Access\TemporaryQueryGuard::alwaysFalse()
  2. 10 core/modules/jsonapi/src/Access/TemporaryQueryGuard.php \Drupal\jsonapi\Access\TemporaryQueryGuard::alwaysFalse()
  3. 11.x 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 550

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.