function Node::__construct

Node constructor.

Parameters

array $configuration: The plugin configuration.

string $plugin_id: The plugin ID.

mixed $plugin_definition: The plugin definition.

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info_service: The entity bundle info service.

\Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository: The entity display repository service.

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

Overrides WizardPluginBase::__construct

File

core/modules/node/src/Plugin/views/wizard/Node.php, line 65

Class

Node
Tests creating node views with the wizard.

Namespace

Drupal\node\Plugin\views\wizard

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeBundleInfoInterface $bundle_info_service, EntityDisplayRepositoryInterface $entity_display_repository = NULL, EntityFieldManagerInterface $entity_field_manager = NULL) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $bundle_info_service);
  if (!$entity_display_repository) {
    @trigger_error('The entity_display.repository service must be passed to ' . __METHOD__ . ', it is required before Drupal 9.0.0. See https://www.drupal.org/node/2835616.', E_USER_DEPRECATED);
    $entity_display_repository = \Drupal::service('entity_display.repository');
  }
  $this->entityDisplayRepository = $entity_display_repository;
  if (!$entity_field_manager) {
    @trigger_error('The entity_field.manager service must be passed to ' . __METHOD__ . ', it is required before Drupal 9.0.0. See https://www.drupal.org/node/2835616.', E_USER_DEPRECATED);
    $entity_field_manager = \Drupal::service('entity_field.manager');
  }
  $this->entityFieldManager = $entity_field_manager;
}

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