Last active
August 28, 2021 00:08
-
-
Save liberatr/9e47e040ea7fc8c519857036e82318f6 to your computer and use it in GitHub Desktop.
A Drupal 8 migrate processor plugin for debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\uwec_migration\Plugin\migrate\process; | |
use Drupal\migrate\MigrateExecutableInterface; | |
use Drupal\migrate\ProcessPluginBase; | |
use Drupal\migrate\Row; | |
/** | |
* This plugin allows your migration to spit the value to the command line. | |
* | |
* Usage, sends back an array of values: | |
* | |
* process: | |
* field_semesters: | |
* plugin: debug | |
* source: semesters | |
* Where "semesters" is the name of your source field, and "field_semesters" is the name | |
* of the Drupal select field. | |
* | |
* @MigrateProcessPlugin( | |
* id = "debug" | |
* ) | |
*/ | |
class Debug extends ProcessPluginBase { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { | |
print_r($value); | |
return $value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment