function SkipOnEmpty::process

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

Stops processing the current property when value is not set.

Parameters

mixed $value: The input value.

\Drupal\migrate\MigrateExecutableInterface $migrate_executable: The migration in which this process is being executed.

\Drupal\migrate\Row $row: The row from the source to process.

string $destination_property: The destination property currently worked on. This is only used together with the $row above.

Return value

mixed The input value, $value, if it is not empty.

Throws

\Drupal\migrate\MigrateSkipProcessException Thrown if the source property is not set and rest of the process should be skipped.

File

core/modules/migrate/src/Plugin/migrate/process/SkipOnEmpty.php, line 113

Class

SkipOnEmpty
Skips processing the current row when the input value is empty.

Namespace

Drupal\migrate\Plugin\migrate\process

Code

public function process($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if (!$value) {
        throw new MigrateSkipProcessException();
    }
    return $value;
}

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