Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.41 KB

deserializer_task.md

File metadata and controls

46 lines (33 loc) · 1.41 KB

DeserializerTask

Deserializes a string input into a PHP value (object, array...) using the Symfony Serializer SerializerInterface.

Requires the Symfony serializer (framework.serializer): without it, the task fails with an explicit message.

Task reference

  • Service: CleverAge\ProcessBundle\Task\Serialization\DeserializerTask
  • Code: deserializer (task: deserializer)

Accepted inputs

string: the serialized data, in the configured format.

Possible outputs

mixed: result of SerializerInterface::deserialize(), matching the configured type.

Options

Code Type Required Default Description
type string X Target type of the deserialization (FQCN, FQCN[], ...)
format string X Format of the input data (json, xml, csv, ...)
context array [] Deserialization context, passed as 4th argument of deserialize()

Examples

  • Deserialize a JSON string into an entity
# Task configuration level
deserialize:
  task: deserializer
  options:
    type: App\Entity\Author
    format: json
  outputs: [save]