annotate core/modules/migrate/src/Plugin/MigrateProcessInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children c2387f117808
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\migrate\Plugin;
Chris@0 4
Chris@0 5 use Drupal\Component\Plugin\PluginInspectionInterface;
Chris@0 6 use Drupal\migrate\MigrateExecutableInterface;
Chris@0 7 use Drupal\migrate\Row;
Chris@0 8
Chris@0 9 /**
Chris@0 10 * An interface for migrate process plugins.
Chris@0 11 *
Chris@0 12 * A process plugin can use any number of methods instead of (but not in
Chris@0 13 * addition to) transform with the same arguments and then the plugin
Chris@0 14 * configuration needs to provide the name of the method to be called via the
Chris@0 15 * "method" key. See \Drupal\migrate\Plugin\migrate\process\SkipOnEmpty and
Chris@0 16 * migrate.migration.d6_field_instance_widget_settings.yml for examples.
Chris@0 17 *
Chris@0 18 * @see \Drupal\migrate\Plugin\MigratePluginManager
Chris@0 19 * @see \Drupal\migrate\ProcessPluginBase
Chris@0 20 * @see \Drupal\migrate\Annotation\MigrateProcessPlugin
Chris@0 21 * @see plugin_api
Chris@0 22 *
Chris@0 23 * @ingroup migration
Chris@0 24 */
Chris@0 25 interface MigrateProcessInterface extends PluginInspectionInterface {
Chris@0 26
Chris@0 27 /**
Chris@0 28 * Performs the associated process.
Chris@0 29 *
Chris@0 30 * @param mixed $value
Chris@0 31 * The value to be transformed.
Chris@0 32 * @param \Drupal\migrate\MigrateExecutableInterface $migrate_executable
Chris@0 33 * The migration in which this process is being executed.
Chris@0 34 * @param \Drupal\migrate\Row $row
Chris@0 35 * The row from the source to process. Normally, just transforming the value
Chris@0 36 * is adequate but very rarely you might need to change two columns at the
Chris@0 37 * same time or something like that.
Chris@0 38 * @param string $destination_property
Chris@0 39 * The destination property currently worked on. This is only used together
Chris@0 40 * with the $row above.
Chris@0 41 *
Chris@0 42 * @return string|array
Chris@0 43 * The newly transformed value.
Chris@0 44 */
Chris@0 45 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property);
Chris@0 46
Chris@0 47 /**
Chris@0 48 * Indicates whether the returned value requires multiple handling.
Chris@0 49 *
Chris@0 50 * @return bool
Chris@0 51 * TRUE when the returned value contains a list of values to be processed.
Chris@0 52 * For example, when the 'source' property is a string and the value found
Chris@0 53 * is an array.
Chris@0 54 */
Chris@0 55 public function multiple();
Chris@0 56
Chris@0 57 }