Commit 88b0d143 authored by DuaelFr's avatar DuaelFr Committed by heddn

Issue #2902867 by DuaelFr, mr.baileys, heddn: Documentation for skip_on_value

parent f95e6b75
......@@ -152,6 +152,11 @@ class EntityLookup extends ProcessPluginBase implements ContainerFactoryPluginIn
* {@inheritdoc}
*/
public function transform($value, MigrateExecutableInterface $migrateExecutable, Row $row, $destinationProperty) {
// If the source data is an empty array, return the same.
if (gettype($value) === 'array' && count($value) === 0) {
return [];
}
// In case of subfields ('field_reference/target_id'), extract the field
// name only.
$parts = explode('/', $destinationProperty);
......
......@@ -20,7 +20,7 @@ use Drupal\migrate\Row;
* - value: An single value or array of values against which the source value
* should be compared.
* - not_equals: (optional) If set, skipping occurs when values are not equal.
* - method: (optional) What to do if the input value is empty. Possible values:
* - method: What to do if the input value is empty. Possible values:
* - row: Skips the entire row when an empty value is encountered.
* - process: Prevents further processing of the input property when the value
* is empty.
......@@ -32,6 +32,7 @@ use Drupal\migrate\Row;
* type:
* plugin: skip_on_value
* source: content_type
* method: row
* value: blog
* @endcode
*
......
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