Commit c8bf9595 authored by benjifisher's avatar benjifisher Committed by Lucas Hedding
Browse files

244: Add a second example to the documentation block

parent 495e992e
......@@ -9,7 +9,7 @@ use Drupal\migrate\ProcessPluginBase;
/**
* Exchange rows and columns.
*
* Example:
* Examples:
*
* @code
* process:
......@@ -25,6 +25,44 @@ use Drupal\migrate\ProcessPluginBase;
* This will create an array of 3-element, numerically indexed arrays. Each
* 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(
* id = "transpose"
* )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment