Commit 559e61a4 authored by alexpott's avatar alexpott

Issue #2845477 by gerzenstl, Jo Fitzgerald, quietone, phenaproxima, xjm: Add...

Issue #2845477 by gerzenstl, Jo Fitzgerald, quietone, phenaproxima, xjm: Add documentation to DefaultValue process plugin
parent 73312ef0
...@@ -7,9 +7,38 @@ ...@@ -7,9 +7,38 @@
use Drupal\migrate\Row; use Drupal\migrate\Row;
/** /**
* This plugin sets missing values on the destination. * Returns a given default value if the input is empty.
* *
* @link https://www.drupal.org/node/2135313 Online handbook documentation for default_value process plugin @endlink * The default_value process plugin provides the ability to set a fixed default
* value. The plugin returns a default value if the input value is considered
* empty (NULL, FALSE, 0, '0', an empty string, or an empty array). The strict
* configuration key can be used to set the default only when the incoming
* value is NULL.
*
* Available configuration keys:
* - default_value: The fixed default value to apply.
* - strict: (optional) Use strict value checking. Defaults to false.
* - FALSE: Apply default when input value is empty().
* - TRUE: Apply default when input value is NULL.
*
* Example:
*
* @code
* process:
* uid:
* -
* plugin: migration
* migration: users
* source: author
* -
* plugin: default_value
* default_value: 44
* @endcode
*
* This will look up the source value of author in the users migration and if
* not found, set the destination property uid to 44.
*
* @see \Drupal\migrate\Plugin\MigrateProcessInterface
* *
* @MigrateProcessPlugin( * @MigrateProcessPlugin(
* id = "default_value" * id = "default_value"
......
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