You are here

public function FilePlainConfigSourceBase::__construct in Media Migration 8

Constructs a plugin instance.

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 current migration.

\Drupal\Core\State\StateInterface $state: The state service.

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

\Drupal\media_migration\FileDealerManagerInterface $file_dealer_manager: The file entity dealer plugin manager.

File

src/Plugin/migrate/source/d7/FilePlainConfigSourceBase.php, line 48

Class

FilePlainConfigSourceBase
Base class for config migrate source plugins of plain file migrations.

Namespace

Drupal\media_migration\Plugin\migrate\source\d7

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state, EntityTypeManagerInterface $entity_type_manager, FileDealerManagerInterface $file_dealer_manager) {
  $configuration += [
    'mimes' => NULL,
    'schemes' => NULL,
  ];
  parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $state, $entity_type_manager);
  $this->fileDealerManager = $file_dealer_manager;
  $this->sourceHasFileEntities = $this
    ->getDatabase()
    ->schema()
    ->fieldExists('file_managed', 'type');
}