Alter an entity query for a specific entity type.
Parameters
\Drupal\Core\Entity\Query\QueryInterface $query: The entity query.
See also
\Drupal\Core\Entity\Query\QueryInterface
Related topics
4 functions implement hook_entity_query_ENTITY_TYPE_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- config_test_entity_query_tag__config_query_test__config_entity_query_alter_hook_test_alter in core/
modules/ config/ tests/ config_test/ config_test.module - Implements hook_entity_query_tag__ENTITY_TYPE__TAG_alter().
- field_test_entity_query_entity_test_mulrev_alter in core/
modules/ field/ tests/ modules/ field_test/ field_test.module - Implements hook_entity_query_ENTITY_TYPE_alter() for 'entity_test_mulrev'.
- field_test_entity_query_tag__entity_query_alter_tag_test_alter in core/
modules/ field/ tests/ modules/ field_test/ field_test.module - Implements hook_entity_query_tag__TAG_alter() for 'entity_query_alter_tag_test'.
- field_test_entity_query_tag__entity_test_mulrev__entity_query_entity_test_mulrev_alter_tag_test_alter in core/
modules/ field/ tests/ modules/ field_test/ field_test.module - Implements hook_entity_query_tag__ENTITY_TYPE__TAG_alter().
File
- core/
lib/ Drupal/ Core/ Entity/ entity.api.php, line 2335 - Hooks and documentation related to entities.
Code
function hook_entity_query_ENTITY_TYPE_alter(\Drupal\Core\Entity\Query\QueryInterface $query) : void {
$query
->condition('id', '1', '<>');
}