Security update for Core, with self-updated composer
[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  * Logs values without changing them.
11  *
12  * The log plugin will log the values that are being processed by other plugins.
13  *
14  * Example:
15  * @code
16  * process:
17  *   bar:
18  *     plugin: log
19  *     source: foo
20  * @endcode
21  *
22  * @see \Drupal\migrate\Plugin\MigrateProcessInterface
23  *
24  * @MigrateProcessPlugin(
25  *   id = "log"
26  * )
27  */
28 class Log extends ProcessPluginBase {
29
30   /**
31    * {@inheritdoc}
32    */
33   public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
34     // Log the value.
35     $migrate_executable->saveMessage($value);
36
37     // Pass through the same value we received.
38     return $value;
39   }
40
41 }