Splice.php in Multiversion 8
File
src/Plugin/migrate/process/Splice.php
View source
<?php
namespace Drupal\multiversion\Plugin\migrate\process;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Plugin\migrate\process\Explode;
use Drupal\migrate\Row;
class Splice extends Explode {
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);
}
public function multiple() {
return TRUE;
}
}
Classes
Name |
Description |
Splice |
Perform custom value transformations. |