Skip to content
Snippets Groups Projects
Select Git revision
  • 8.x-1.x
  • 2.0.x default
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • 8.x-1.0
6 results

Vardump.php

Blame
  • socketwench's avatar
    Tess authored
    2d5cc619
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Vardump.php 695 B
    <?php
    
    namespace Drupal\migrate_process_vardump\Plugin\migrate\process;
    
    
    use Drupal\migrate\MigrateExecutableInterface;
    use Drupal\migrate\ProcessPluginBase;
    use Drupal\migrate\Row;
    use Drupal\Core\Database\Database;
    
    /**
     * Dumps the input value to stdout. Passes the rest through.
     *
     * @MigrateProcessPlugin(
     *   id = "vardump"
     * )
     *
     */
    class Vardump extends ProcessPluginBase {
    
      /**
       * {@inheritdoc}
       */
      public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    
        if (!empty($this->configuration['header'])) {
          echo $this->configuration['header'] . ': ';
        }
    
        var_dump($value);
    
        return $value;
      }
    
    }