You are here

public function EntityFile::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/file/src/Plugin/migrate/destination/EntityFile.php \Drupal\file\Plugin\migrate\destination\EntityFile::__construct()

Constructs a content 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\Entity\MigrationInterface $migration: The migration entity.

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

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

\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager service.

\Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager: The field type plugin manager service.

Overrides EntityContentBase::__construct

1 method overrides EntityFile::__construct()
TestEntityFile::__construct in core/modules/file/src/Tests/Migrate/EntityFileTest.php
Constructs a content entity.

File

core/modules/file/src/Plugin/migrate/destination/EntityFile.php, line 47
Contains \Drupal\file\Plugin\migrate\destination\EntityFile.

Class

EntityFile
Every migration that uses this destination must have an optional dependency on the d6_file migration to ensure it runs first.

Namespace

Drupal\file\Plugin\migrate\destination

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_manager, StreamWrapperManagerInterface $stream_wrappers, FileSystemInterface $file_system) {
  $configuration += array(
    'source_base_path' => '',
    'source_path_property' => 'filepath',
    'destination_path_property' => 'uri',
    'move' => FALSE,
    'urlencode' => FALSE,
  );
  parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $entity_manager, $field_type_manager);
  $this->streamWrapperManager = $stream_wrappers;
  $this->fileSystem = $file_system;
}