sajad torkamani


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.


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.