ReinstallFileSource.php 658 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Drupal\reinstall\Plugin\migrate\source;
  3. use Drupal\migrate\Plugin\MigrationInterface;
  4. /**
  5. * Source plugin for files from a YAML file.
  6. *
  7. * @MigrateSource(
  8. * id = "reinstall_files"
  9. * )
  10. */
  11. class ReinstallFileSource extends SimpleSource {
  12. /**
  13. * Constructor.
  14. */
  15. public function __construct(
  16. array $configuration,
  17. string $pluginId,
  18. array $pluginDefinition,
  19. MigrationInterface $migration
  20. ) {
  21. parent::__construct($configuration, $pluginId, $pluginDefinition, $migration);
  22. $rawRecords = array_map([$this, 'flattenRecord'], $this->initialParse($configuration));
  23. $this->records = $rawRecords;
  24. }
  25. }