sajad torkamani

Normalizer

Converts PHP entities (e.g., Doctrine entity or a DTO) into a PHP array which is then encoded into another format like JSON.

Typical use cases:

  • Hide fields if the user doesn’t have the right permissions.
  • Add extra fields to the response.

Denormalizer

Converts a PHP array into a PHP object (e.g., Doctrine entity).

Typical use cases:

  • Set an entity’s user to the current user (e.g., $article->setUser($this->security->getUser().
  • Decode a base-64 encoded string in the request payload to upload a file to S3.

Leave a comment

Your email address will not be published. Required fields are marked *