You are here

public function WizardPluginBase::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php \Drupal\views\Plugin\views\wizard\WizardPluginBase::__construct()

Constructs a WizardPluginBase object.

Overrides PluginBase::__construct

1 call to WizardPluginBase::__construct()
Node::__construct in core/modules/node/src/Plugin/views/wizard/Node.php
Node constructor.
1 method overrides WizardPluginBase::__construct()
Node::__construct in core/modules/node/src/Plugin/views/wizard/Node.php
Node constructor.

File

core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php, line 143

Class

WizardPluginBase
Base class for Views wizard plugins.

Namespace

Drupal\views\Plugin\views\wizard

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeBundleInfoInterface $bundle_info_service, MenuParentFormSelectorInterface $parent_form_selector = NULL) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->bundleInfoService = $bundle_info_service;
  $this->base_table = $this->definition['base_table'];
  if (!$parent_form_selector) {
    @trigger_error('Calling ' . __METHOD__ . '() without the $parent_form_selector argument is deprecated in drupal:9.3.0 and the $parent_form_selector argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3027559', E_USER_DEPRECATED);
    $parent_form_selector = \Drupal::service('menu.parent_form_selector');
  }
  $this->parentFormSelector = $parent_form_selector;
  $entity_types = \Drupal::entityTypeManager()
    ->getDefinitions();
  foreach ($entity_types as $entity_type_id => $entity_type) {
    if (in_array($this->base_table, [
      $entity_type
        ->getBaseTable(),
      $entity_type
        ->getDataTable(),
      $entity_type
        ->getRevisionTable(),
      $entity_type
        ->getRevisionDataTable(),
    ], TRUE)) {
      $this->entityType = $entity_type;
      $this->entityTypeId = $entity_type_id;
    }
  }
}