diff core/modules/migrate/src/MigrateExecutableInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children c2387f117808
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/migrate/src/MigrateExecutableInterface.php	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,49 @@
+<?php
+
+namespace Drupal\migrate;
+
+use Drupal\migrate\Plugin\MigrationInterface;
+
+interface MigrateExecutableInterface {
+
+  /**
+   * Performs an import operation - migrate items from source to destination.
+   */
+  public function import();
+
+  /**
+   * Performs a rollback operation - remove previously-imported items.
+   */
+  public function rollback();
+
+  /**
+   * Processes a row.
+   *
+   * @param \Drupal\migrate\Row $row
+   *   The $row to be processed.
+   * @param array $process
+   *   (optional) A process pipeline configuration. If not set, the top level
+   *   process configuration in the migration entity is used.
+   * @param mixed $value
+   *   (optional) Initial value of the pipeline for the first destination.
+   *   Usually setting this is not necessary as $process typically starts with
+   *   a 'get'. This is useful only when the $process contains a single
+   *   destination and needs to access a value outside of the source. See
+   *   \Drupal\migrate\Plugin\migrate\process\Iterator::transformKey for an
+   *   example.
+   *
+   * @throws \Drupal\migrate\MigrateException
+   */
+  public function processRow(Row $row, array $process = NULL, $value = NULL);
+
+  /**
+   * Passes messages through to the map class.
+   *
+   * @param string $message
+   *   The message to record.
+   * @param int $level
+   *   (optional) Message severity (defaults to MESSAGE_ERROR).
+   */
+  public function saveMessage($message, $level = MigrationInterface::MESSAGE_ERROR);
+
+}