Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.49 KB

property_getter_task.md

File metadata and controls

58 lines (42 loc) · 1.49 KB

PropertyGetterTask

Reads a value from the input (array or object) using a property path, and outputs it.

See the PropertyAccess component documentation for the property path syntax.

Task reference

  • Service: CleverAge\ProcessBundle\Task\PropertyGetterTask
  • Code: property_getter (task: property_getter)

Accepted inputs

array or object readable by the property accessor at the given property path.

Possible outputs

mixed: the value read at the property path.

If the value cannot be read (including a \TypeError of the property accessor, e.g. on a scalar input), the exception is set on the state (with the property added to the error context) and handled according to the task error_strategy.

Options

Code Type Required Default Description
property string X Property path to read from the input

Examples

  • Extract the path of each file listed by a Flysystem task
# Task configuration level
get_file_path:
  task: property_getter
  options:
    property: 'path'
  outputs: [remove_input]
  • Read a key from an array input
# Task configuration level
get_sku:
  task: property_getter
  options:
    property: '[sku]'
  outputs: [next_task]