af262ff5621308f229df56c2498328169b9a6ce8
[yaffs-website] / web / core / modules / migrate / src / Plugin / migrate / process / Log.php
1 <?php
2
3 namespace Drupal\migrate\Plugin\migrate\process;
4
5 use Drupal\migrate\MigrateExecutableInterface;
6 use Drupal\migrate\ProcessPluginBase;
7 use Drupal\migrate\Row;
8
9
10 /**
11  * Logs values without changing them.
12  *
13  * The log plugin will log the values that are being processed by other plugins.
14  *
15  * Example:
16  * @code
17  * process:
18  *   bar:
19  *     plugin: log
20  *     source: foo
21  * @endcode
22  *
23  * @see \Drupal\migrate\Plugin\MigrateProcessInterface
24  *
25  * @MigrateProcessPlugin(
26  *   id = "log"
27  * )
28  */
29 class Log extends ProcessPluginBase {
30
31   /**
32    * {@inheritdoc}
33    */
34   public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
35     // Log the value.
36     $migrate_executable->saveMessage($value);
37
38     // Pass through the same value we received.
39     return $value;
40   }
41
42 }