|
@@ -0,0 +1,49 @@
|
|
|
+<?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_paragraphs"
|
|
|
+ * )
|
|
|
+ */
|
|
|
+class ReinstallNodeSource extends SimpleSource {
|
|
|
+ const ENTITY_TYPE = 'node';
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 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 = [
|
|
|
+ 'nid' => [
|
|
|
+ 'type' => 'integer',
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+
|
|
|
+ return $ids;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|