function Concat::transform

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

Overrides ProcessPluginBase::transform

File

core/modules/migrate/src/Plugin/migrate/process/Concat.php, line 64

Class

Concat
Concatenates a set of strings.

Namespace

Drupal\migrate\Plugin\migrate\process

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if (is_array($value)) {
        $delimiter = isset($this->configuration['delimiter']) ? $this->configuration['delimiter'] : '';
        return implode($delimiter, $value);
    }
    else {
        throw new MigrateException(sprintf('%s is not an array', var_export($value, TRUE)));
    }
}

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