function UniqueFieldConstraintTestHooks::queryEntityTestAccessAlter

Implements hook_query_entity_test_access_alter().

File

core/modules/system/tests/modules/unique_field_constraint_test/src/Hook/UniqueFieldConstraintTestHooks.php, line 34

Class

UniqueFieldConstraintTestHooks
Hook implementations for unique_field_constraint_test.

Namespace

Drupal\unique_field_constraint_test\Hook

Code

public function queryEntityTestAccessAlter(AlterableInterface $query) : void {
    // Set an impossible condition to filter out all entities.
    
    /** @var \Drupal\Core\Database\Query\Select|\Drupal\Core\Database\Query\AlterableInterface $query */
    $query->condition('entity_test.id', 0);
}

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