You are here

function entity_views_query_alter in Entity API 8

Implements hook_views_query_alter().

File

./entity.module, line 162
Provides expanded entity APIs.

Code

function entity_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
  if ($query instanceof Sql && empty($query->options['disable_sql_rewrite'])) {
    \Drupal::service('class_resolver')
      ->getInstanceFromDefinition(ViewsQueryAlter::class)
      ->alter($query, $view);
  }
}