diff --git a/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php index 604c024..1d68f35 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php +++ b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php @@ -47,26 +47,44 @@ * @code * process: * id: - * plugin: static_map - * source: - * - module - * - delta - * map: - * filter: - * 0: filter_html_escape - * 1: filter_autop - * 2: filter_url - * 3: filter_htmlcorrector - * 4: filter_html_escape - * php: - * 0: php_code + * plugin: static_map + * source: + * - module + * - delta + * map: + * filter: + * 0: filter_html_escape + * 1: filter_autop + * 2: filter_url + * 3: filter_htmlcorrector + * 4: filter_html_escape + * php: + * 0: php_code * @endcode * * If the value of the source properties module and delta are "filter" and "2" * respectively, then the returned value will be "filter_url". By default, if a - * value is not found in the map, an exception is thrown. When static_map is - * used to just rename a few things and leave the others, a "bypass: true" - * option can be added. In this case, the source value is used unchanged. + * value is not found in the map, an exception is thrown. + * + * When static_map is used to just rename a few things and leave the others, a + * "bypass: true" option can be added. In this case, the source value is used + * unchanged, e.g.: + * + * @code + * process: + * bar: + * plugin: static_map + * source: foo + * map: + * from: to + * this: that + * bypass: TRUE + * @endcode + * + * If the value of the source property "foo" is "from" then the returned value + * will be "to", but if the value of "foo" is "another" (a value that is not in + * the map) then the source value is used unchanged so the returned value will + * be "from" because "bypass" is set to TRUE. * * @code * process: @@ -79,9 +97,9 @@ * default_value: bar * @endcode * - * If the lookup fails, this default_value is used instead. Note that using the - * default value plugin after would not work as the pipeline has a value at this - * point: the value of the source specified for the static_map. + * If the value of the source property "foo" is "yet_another" (a value that is + * not in the map) then the default_value is used so the returned value will + * be "bar". * * @see \Drupal\migrate\Plugin\MigrateProcessInterface *