You are here

public function ContentEntity::__construct in Workbench Moderation to Content Moderation 8.2

ContentEntity constructor.

Parameters

array $configuration: Plugin configuration.

string $plugin_id: The plugin ID.

mixed $plugin_definition: The plugin definition.

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

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

Overrides SourcePluginBase::__construct

File

src/Plugin/migrate/source/ContentEntity.php, line 43

Class

ContentEntity
Loads certain fields from all content entities of a specific type.

Namespace

Drupal\wbm2cm\Plugin\migrate\source

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityTypeManagerInterface $entity_type_manager) {

  // Merge in default configuration.
  $configuration += [
    'fields' => [],
    'keys' => [
      'id',
    ],
    'include_translations' => TRUE,
  ];
  parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
  $this->storage = $entity_type_manager
    ->getStorage($this
    ->getDerivativeId());
}