function TaxonomyTestHooks::queryAlter

Implements hook_query_alter().

Attributes

#[Hook('query_alter')]

File

core/modules/taxonomy/tests/modules/taxonomy_test/src/Hook/TaxonomyTestHooks.php, line 38

Class

TaxonomyTestHooks
Hook implementations for taxonomy_test.

Namespace

Drupal\taxonomy_test\Hook

Code

public function queryAlter(AlterableInterface $query) : void {
  $value = \Drupal::state()->get('taxonomy_test_query_alter');
  if (isset($value)) {
    \Drupal::state()->set('taxonomy_test_query_alter', ++$value);
  }
}

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