Skip to content
Snippets Groups Projects
Commit c8bf9595 authored by Benji Fisher's avatar Benji Fisher Committed by Lucas Hedding
Browse files

244: Add a second example to the documentation block

parent 495e992e
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ use Drupal\migrate\ProcessPluginBase; ...@@ -9,7 +9,7 @@ use Drupal\migrate\ProcessPluginBase;
/** /**
* Exchange rows and columns. * Exchange rows and columns.
* *
* Example: * Examples:
* *
* @code * @code
* process: * process:
...@@ -25,6 +25,44 @@ use Drupal\migrate\ProcessPluginBase; ...@@ -25,6 +25,44 @@ use Drupal\migrate\ProcessPluginBase;
* This will create an array of 3-element, numerically indexed arrays. Each * This will create an array of 3-element, numerically indexed arrays. Each
* array will have one element from each of the source properties. * array will have one element from each of the source properties.
* *
* @code
* process:
* field_link:
* -
* plugin: transpose
* source:
* - link_url
* - link_text
* -
* plugin: sub_process
* process:
* uri:
* -
* plugin: extract
* source:
* - 0
* index:
* - 0
* -
* plugin: link_uri
* validate_route: false
* title:
* -
* plugin: extract
* source:
* - 1
* index:
* - 0
* @endcode
*
* Suppose the source property link_url has the URL for three links, and the
* source property link_text has the corresponding link text:
* [url0, url1, url2] and [text0, text1, text2].
* Then the transpose plugin produces
* [[url0, text0], [url1, text1], [url2, text2]].
* Inside sub_process, the extract plugin in this example takes each
* [url, text] subarray and assigns uri: url, title: text.
*
* @MigrateProcessPlugin( * @MigrateProcessPlugin(
* id = "transpose" * id = "transpose"
* ) * )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment