You are here

public function Splice::transform in Multiversion 8

Throws

\Drupal\migrate\MigrateException

Overrides Explode::transform

File

src/Plugin/migrate/process/Splice.php, line 24

Class

Splice
Perform custom value transformations.

Namespace

Drupal\multiversion\Plugin\migrate\process

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
  $value = parent::transform($value, $migrate_executable, $row, $destination_property);
  if (isset($this->configuration['slice'])) {
    $value = array_splice($value, 0, $this->configuration['slice']);
  }
  return implode($this->configuration['delimiter'], $value);
}