12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace Drupal\reinstall\Plugin\migrate\source;
- use Drupal\Core\Entity\EntityFieldManagerInterface;
- use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
- use Drupal\migrate\Plugin\MigrationInterface;
- /**
- * Source plugin for terms from a YAML file.
- *
- * @MigrateSource(
- * id = "reinstall_files"
- * )
- */
- class ReinstallFileSource extends SimpleSource {
- const ENTITY_TYPE = 'file';
- /**
- * Constructor.
- */
- public function __construct(
- array $configuration,
- string $pluginId,
- array $pluginDefinition,
- MigrationInterface $migration,
- EntityTypeBundleInfoInterface $ebi,
- EntityFieldManagerInterface $efm
- ) {
- parent::__construct($configuration, $pluginId, $pluginDefinition, $migration, $ebi, $efm);
- $rawRecords = array_map([$this, 'flattenRecord'], $this->initialParse($configuration));
- $this->records = $rawRecords;
- }
- /**
- * {@inheritdoc}
- */
- public function getIds() {
- $ids = [
- 'fid' => [
- 'type' => 'integer',
- ],
- ];
- return $ids;
- }
- }
|