3 namespace Drupal\migrate_plus\Plugin\migrate\process;
5 use Drupal\migrate\MigrateExecutableInterface;
6 use Drupal\migrate\ProcessPluginBase;
7 use Drupal\migrate\Row;
10 * Treat an array of values as a single value.
20 * plugin: single_value
23 * Assume the "authors" field contains comma separated author names.
25 * After the explode, we end up with each author name as an individual value.
26 * But if we want to perform a sort on all values using a callback, we will
27 * need to send all the values to a callable together as an array of author
28 * names. Calling the "single_value" plugin in such a case will combine all the
29 * values into a single array for the next plugin.
31 * @MigrateProcessPlugin(
32 * id = "single_value",
33 * handle_multiples = TRUE
36 class SingleValue extends ProcessPluginBase {
41 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {