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 separate / individual values.
20 * plugin: single_value
23 * callable: custom_sort_authors
25 * plugin: multiple_values
28 * Assume the "authors" field contains comma separated author names.
30 * We split the names into multiple values and then use the "single_value"
31 * plugin to treat them as a single array of author names. After that, we
32 * pass the values through a custom sort. Callback multiple setting is false. To
33 * convert from a single value to multiple, use the "multiple_values" plugin. It
34 * will make the next plugin treat the values individually instead of an array
37 * @MigrateProcessPlugin(
38 * id = "multiple_values",
39 * handle_multiples = TRUE
42 class MultipleValues extends ProcessPluginBase {
47 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
54 public function multiple() {