Sets static values on the input (array or object) using property paths, then outputs the modified input.
See the PropertyAccess component documentation for the property path syntax.
- Service:
CleverAge\ProcessBundle\Task\PropertySetterTask
array or object writable by the property accessor at the given property paths.
The input, with the configured values set.
If a value cannot be set (including a \TypeError of the property accessor, e.g. on a scalar input), the exception
is set on the state (with property and value added to the error context)
and handled according to the task error_strategy; the remaining values are not set.
| Code | Type | Required | Default | Description |
|---|---|---|---|---|
values |
array |
X | Map of property path => value to set on the input |
- Change the first name of an entity
# Task configuration level
modify:
service: '@CleverAge\ProcessBundle\Task\PropertySetterTask'
options:
values:
firstname: Gérard
outputs: [dump_modified]- Set keys on an array input
# Task configuration level
set_defaults:
service: '@CleverAge\ProcessBundle\Task\PropertySetterTask'
options:
values:
'[status]': imported
'[source]': '{{ source }}'
outputs: [next_task]