You are here

public function Entity::__construct in Drupal 10

Same name in this branch
  1. 10 core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::__construct()
  2. 10 core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::__construct()
  3. 10 core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::__construct()
Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::__construct()
  2. 9 core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::__construct()

Construct a new entity.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\migrate\Plugin\MigrationInterface $migration: The migration.

\Drupal\Core\Entity\EntityStorageInterface $storage: The storage for this entity type.

array $bundles: The list of bundles this entity type has.

Overrides DestinationBase::__construct

2 calls to Entity::__construct()
EntityConfigBase::__construct in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
Construct a new entity.
EntityContentBase::__construct in core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
Constructs a content entity.
2 methods override Entity::__construct()
EntityConfigBase::__construct in core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php
Construct a new entity.
EntityContentBase::__construct in core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php
Constructs a content entity.

File

core/modules/migrate/src/Plugin/migrate/destination/Entity.php, line 96

Class

Entity
Provides a generic destination to import entities.

Namespace

Drupal\migrate\Plugin\migrate\destination

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles) {
  $plugin_definition += [
    'label' => $storage
      ->getEntityType()
      ->getPluralLabel(),
  ];
  parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
  $this->storage = $storage;
  $this->bundles = $bundles;
  $this->supportsRollback = TRUE;
}