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