function EntityViewsData::createInstance

Same name in other branches
  1. 9 core/modules/views/src/EntityViewsData.php \Drupal\views\EntityViewsData::createInstance()
  2. 8.9.x core/modules/views/src/EntityViewsData.php \Drupal\views\EntityViewsData::createInstance()
  3. 10 core/modules/views/src/EntityViewsData.php \Drupal\views\EntityViewsData::createInstance()

Overrides EntityHandlerInterface::createInstance

File

core/modules/views/src/EntityViewsData.php, line 104

Class

EntityViewsData
Provides generic views integration for entities.

Namespace

Drupal\views

Code

public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
    return new static($entity_type, $container->get('entity_type.manager')
        ->getStorage($entity_type->id()), $container->get('entity_type.manager'), $container->get('module_handler'), $container->get('string_translation'), $container->get('entity_field.manager'));
}

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