Deserializes a string input into a PHP value (object, array...) using the Symfony Serializer SerializerInterface.
- Service:
CleverAge\ProcessBundle\Task\Serialization\DeserializerTask
string: the serialized data, in the configured format.
mixed: result of SerializerInterface::deserialize(), matching the configured type.
| 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() |
- Deserialize a JSON string into an entity
# Task configuration level
deserialize:
service: '@CleverAge\ProcessBundle\Task\Serialization\DeserializerTask'
options:
type: App\Entity\Author
format: json
outputs: [save]