function FieldTestHooks::entityQueryAlter

Same name and namespace in other branches
  1. 11.x core/modules/field/tests/modules/field_test/src/Hook/FieldTestHooks.php \Drupal\field_test\Hook\FieldTestHooks::entityQueryAlter()

Implements hook_entity_query_alter().

Attributes

#[Hook('entity_query_alter')]

See also

Drupal\KernelTests\Core\Entity\EntityQueryTest::testAlterHook

File

core/modules/field/tests/modules/field_test/src/Hook/FieldTestHooks.php, line 147

Class

FieldTestHooks
Hook implementations for field_test.

Namespace

Drupal\field_test\Hook

Code

public function entityQueryAlter(QueryInterface $query) : void {
  if ($query->hasTag('entity_query_alter_hook_test')) {
    $query->condition('id', '5', '<>');
  }
}

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