You are here

class EntityTypeAlter in EntityFieldQuery Views Backend 8

Hierarchy

Expanded class hierarchy of EntityTypeAlter

1 string reference to 'EntityTypeAlter'
efq_views.services.yml in ./efq_views.services.yml
efq_views.services.yml
1 service uses EntityTypeAlter
efq_views.hooks.entity_type_alter in ./efq_views.services.yml
\Drupal\efq_views\Hooks\EntityTypeAlter

File

src/Hooks/EntityTypeAlter.php, line 12
Contains \Drupal\efq_views\Hooks\EntityTypeAlter.

Namespace

Drupal\efq_views\Hooks
View source
class EntityTypeAlter {

  /**
   * Implements hook_entity_type_alter().
   */
  public function alter(array &$entity_types) {

    /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */

    // Replace all used views data handlers with a custom one.
    // @todo Decide the right strategy here.
    foreach ($entity_types as $entity_type) {
      if ($entity_type
        ->hasHandlerClass('views_data')) {
        $entity_type
          ->setHandlerClass('views_data', EqViewsData::class);
      }
    }
  }

}

Members