Unverified Commit 499e358a authored by alexpott's avatar alexpott

Issue #3197749 by quietone, joachim: empty migrate source does not populate fields with constants

parent 203ad064
......@@ -15,8 +15,9 @@
* field_name: image
* @endcode
*
* This will return a single row containing 'entity_type' and 'field_name'
* elements, with values of 'user' and 'image', respectively.
* This will return a single row containing 'constants/entity_type' and
* 'constants/field_name' elements, with values of 'user' and 'image',
* respectively.
*
* @MigrateSource(
* id = "empty",
......
......@@ -24,6 +24,8 @@
* (optional table alias). This high_water_property is typically a timestamp
* or serial id showing what was the last imported record. Only content with a
* higher value will be imported.
* - constants: (optional) An array of constants that can be used in the process
* pipeline. To use the constant 'foo' as a source value use 'constants/foo'.
*
* The high_water_property and track_changes are mutually exclusive.
*
......@@ -58,6 +60,20 @@
* migration. This will get converted into a SQL condition that looks like
* 'n.changed' or 'changed' if no alias.
*
* Example:
*
* @code
* source:
* plugin: some_source_plugin_name
* constants:
* - foo: bar
* process:
* baz: constants/bar
* @endcode
*
* In this example, the constant 'foo' is defined with a value of 'bar'. It is
* later used in the process pipeline to set the value of the field baz.
*
* @see \Drupal\migrate\Plugin\MigratePluginManager
* @see \Drupal\migrate\Annotation\MigrateSource
* @see \Drupal\migrate\Plugin\MigrateSourceInterface
......
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