function Entity::__construct

Same name in this branch
  1. 10 core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::__construct()
  2. 10 core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::__construct()
Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::__construct()
  2. 9 core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::__construct()
  3. 9 core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::__construct()
  4. 8.9.x core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::__construct()
  5. 8.9.x core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::__construct()
  6. 8.9.x core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::__construct()
  7. 11.x core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::__construct()
  8. 11.x core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::__construct()
  9. 11.x 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 107

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;
}

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