Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / migrate_MIGRATION_ID_prepare_row.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migrate_MIGRATION_ID_prepare_row.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/migrate_MIGRATION_ID_prepare_row.twig
new file mode 100644 (file)
index 0000000..69aee23
--- /dev/null
@@ -0,0 +1,9 @@
+/**
+ * Implements hook_migrate_MIGRATION_ID_prepare_row().
+ */
+function {{ machine_name }}_migrate_MIGRATION_ID_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) {
+  $value = $source->getDatabase()->query('SELECT value FROM {variable} WHERE name = :name', [':name' => 'mymodule_filter_foo_' . $row->getSourceProperty('format')])->fetchField();
+  if ($value) {
+    $row->setSourceProperty('settings:mymodule:foo', unserialize($value));
+  }
+}