Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/migrate/src/Plugin/MigrateProcessInterface.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
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 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. | |
22 * | |
23 * @see \Drupal\migrate\Plugin\MigratePluginManager | |
24 * @see \Drupal\migrate\ProcessPluginBase | |
25 * @see \Drupal\migrate\Annotation\MigrateProcessPlugin | |
26 * @see plugin_api | |
27 * | |
28 * @ingroup migration | |
29 */ | |
30 interface MigrateProcessInterface extends PluginInspectionInterface { | |
31 | |
32 /** | |
33 * Performs the associated process. | |
34 * | |
35 * @param mixed $value | |
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. | |
46 * | |
47 * @return string|array | |
48 * The newly transformed value. | |
49 */ | |
50 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property); | |
51 | |
52 /** | |
53 * Indicates whether the returned value requires multiple handling. | |
54 * | |
55 * @return bool | |
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 | |
58 * is an array. | |
59 */ | |
60 public function multiple(); | |
61 | |
62 } |