function SkipRowIfNotSet::transform

Same name in other branches
  1. 9 core/modules/migrate/src/Plugin/migrate/process/SkipRowIfNotSet.php \Drupal\migrate\Plugin\migrate\process\SkipRowIfNotSet::transform()
  2. 10 core/modules/migrate/src/Plugin/migrate/process/SkipRowIfNotSet.php \Drupal\migrate\Plugin\migrate\process\SkipRowIfNotSet::transform()
  3. 11.x core/modules/migrate/src/Plugin/migrate/process/SkipRowIfNotSet.php \Drupal\migrate\Plugin\migrate\process\SkipRowIfNotSet::transform()

Overrides ProcessPluginBase::transform

File

core/modules/migrate/src/Plugin/migrate/process/SkipRowIfNotSet.php, line 50

Class

SkipRowIfNotSet
Skips processing the current row when a source value is not set.

Namespace

Drupal\migrate\Plugin\migrate\process

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if (!isset($value[$this->configuration['index']])) {
        $message = !empty($this->configuration['message']) ? $this->configuration['message'] : '';
        throw new MigrateSkipRowException($message);
    }
    return $value[$this->configuration['index']];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.