3 namespace Drupal\migrate\Plugin;
5 use Drupal\Component\Plugin\PluginInspectionInterface;
6 use Drupal\migrate\MigrateExecutableInterface;
7 use Drupal\migrate\Row;
10 * An interface for migrate process plugins.
12 * A process plugin will typically implement the transform() method to perform
13 * its work. However, it is possible instead for a process plugin to use any
14 * number of methods, thus offering different alternatives ways of processing.
15 * In this case, the transform() method should not be implemented, and the
16 * plugin configuration must provide the name of the method to be called via the
17 * "method" key. Each method must have the same signature as transform().
18 * The base class \Drupal\migrate\ProcessPluginBase takes care of implementing
19 * transform() and calling the configured method. See
20 * \Drupal\migrate\Plugin\migrate\process\SkipOnEmpty and
21 * d6_field_instance_widget_settings.yml for examples.
23 * @see \Drupal\migrate\Plugin\MigratePluginManager
24 * @see \Drupal\migrate\ProcessPluginBase
25 * @see \Drupal\migrate\Annotation\MigrateProcessPlugin
30 interface MigrateProcessInterface extends PluginInspectionInterface {
33 * Performs the associated process.
36 * The value to be transformed.
37 * @param \Drupal\migrate\MigrateExecutableInterface $migrate_executable
38 * The migration in which this process is being executed.
39 * @param \Drupal\migrate\Row $row
40 * The row from the source to process. Normally, just transforming the value
41 * is adequate but very rarely you might need to change two columns at the
42 * same time or something like that.
43 * @param string $destination_property
44 * The destination property currently worked on. This is only used together
45 * with the $row above.
47 * @return string|array
48 * The newly transformed value.
50 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property);
53 * Indicates whether the returned value requires multiple handling.
56 * TRUE when the returned value contains a list of values to be processed.
57 * For example, when the 'source' property is a string and the value found
60 public function multiple();