Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.41 KB

normalizer_task.md

File metadata and controls

47 lines (34 loc) · 1.41 KB

NormalizerTask

Normalizes the input (usually an object) using the Symfony Serializer NormalizerInterface.

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

Task reference

  • Service: CleverAge\ProcessBundle\Task\Serialization\NormalizerTask
  • Code: normalizer (task: normalizer)

Accepted inputs

mixed: any value supported by the normalizers for the given format. If no normalizer supports it, an UnexpectedValueException is thrown.

Possible outputs

array|string|int|float|bool|\ArrayObject|null: result of NormalizerInterface::normalize() (usually an array).

Options

Code Type Required Default Description
format string X Format passed to the normalizer (json, xml, ...)
context array [] Normalization context, passed as 3rd argument of normalize()

Examples

  • Normalize entities read from Doctrine into arrays, restricted to a serialization group
# Task configuration level
normalize:
  task: normalizer
  options:
    format: json
    context:
      groups: [export]
  outputs: [write]