function NodeViewsData::__construct

Constructs an NodeViewsData object.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type to provide views integration for.

\Drupal\Core\Entity\Sql\SqlEntityStorageInterface $storage_controller: The storage handler used for this entity type.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\StringTranslation\TranslationInterface $translation_manager: The translation manager.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The entity field manager.

\Drupal\Core\Extension\ModuleExtensionList|null $moduleExtensionList: The module extension list.

Overrides EntityViewsData::__construct

File

core/modules/node/src/NodeViewsData.php, line 39

Class

NodeViewsData
Provides the views data for the node entity type.

Namespace

Drupal\node

Code

public function __construct(EntityTypeInterface $entity_type, SqlEntityStorageInterface $storage_controller, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, TranslationInterface $translation_manager, EntityFieldManagerInterface $entity_field_manager, protected ?ModuleExtensionList $moduleExtensionList = NULL) {
  parent::__construct($entity_type, $storage_controller, $entity_type_manager, $module_handler, $translation_manager, $entity_field_manager);
  if ($this->moduleExtensionList === NULL) {
    @trigger_error('Calling ' . __METHOD__ . '() without the $moduleExtensionList argument is deprecated in drupal:11.2.0 and will be required in drupal:12.0.0. See https://www.drupal.org/node/3493129', E_USER_DEPRECATED);
    $this->moduleExtensionList = \Drupal::service('extension.list.module');
  }
}

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