Commit 4ea838b4 authored by alexpott's avatar alexpott

Issue #2845482 by Jo Fitzgerald, Yogesh Pawar, quietone, phenaproxima,...

Issue #2845482 by Jo Fitzgerald, Yogesh Pawar, quietone, phenaproxima, ultimike: Add documentation to Get process plugin
parent 458de4e5
......@@ -7,9 +7,87 @@
use Drupal\migrate\Row;
/**
* This plugin copies from the source to the destination.
* Gets the source value.
*
* @link https://www.drupal.org/node/2135307 Online handbook documentation for get process plugin @endlink
* Available configuration keys:
* - source: Source property.
*
* The get plugin returns the value of the property given by the "source"
* configuration key.
*
* Examples:
*
* @code
* process:
* bar:
* plugin: get
* source: foo
* @endcode
*
* This copies the source value of foo to the destination property "bar".
*
* Since get is the default process plugin, it can be shorthanded like this:
*
* @code
* process:
* bar: foo
* @endcode
*
* get also supports a list of source properties.
*
* Example:
*
* @code
* process:
* bar:
* plugin: get
* source:
* - foo1
* - foo2
* @endcode
*
* This copies the array of source values [foo1, foo2] to the destination
* property "bar".
*
* If the list of source properties contains an empty element then the current
* value will be used. This makes it impossible to reach a source property with
* an empty string as its name.
*
* get also supports copying destination values. These are indicated by a
* starting @ sign. Values using @ must be wrapped in quotes.
*
* @code
* process:
* foo:
* plugin: machine_name
* source: baz
* bar:
* plugin: get
* source: '@foo'
* @endcode
*
* This will simply copy the destination value of foo to the destination
* property bar. foo configuration is included for illustration purposes.
*
* Because of this, if your source or destination property actually starts with
* a @ you need to double those starting characters up. This means that if a
* destination property happens to start with a @ and you want to refer it,
* you'll need to start with three @ characters -- one to indicate the
* destination and two for escaping the real @.
*
* @code
* process:
* @foo:
* plugin: machine_name
* source: baz
* bar:
* plugin: get
* source: '@@@foo'
* @endcode
*
* This should occur extremely rarely.
*
* @see \Drupal\migrate\Plugin\MigrateProcessInterface
*
* @MigrateProcessPlugin(
* id = "get"
......
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