Download the PHP package bigyohann/symfony-dto-bundle without Composer
On this page you can find all versions of the php package bigyohann/symfony-dto-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bigyohann/symfony-dto-bundle
More information about bigyohann/symfony-dto-bundle
Files in bigyohann/symfony-dto-bundle
Package symfony-dto-bundle
Short Description Symfony bundle to add automatic Dto converter
License MIT
Informations about the package symfony-dto-bundle
Symfony DTO Bundle
Motivation
- Create and deploy a lib to packagist
- Create a bundle for Symfony
- Facilitate the way of handle serializing
Usage
Extends your Dto class from Bigyohann\DtoBundle\Dto\Dto
,
make all your properties private and add getter.
By default, I add a convert function to automatically set Dto properties to object passed as parameter.
You can annotate your property with attribute
Bigyohann\DtoBundle\Attributes\ConvertProperty
and if parameter
shouldConvertAutomatically
is set at false, property will not be
mapped to object passed as parameter, but you can still access it in Dto if you want to
do a specific action with this value.
if you don't want to use convert function, you can use
Bigyohann\DtoBundle\Dto\DtoInterface
.
Exemple
Inject Dto directly in Controller functions
All versions of symfony-dto-bundle with dependencies
ext-ctype Version *
ext-iconv Version *
symfony/framework-bundle Version >=6.2
symfony/runtime Version 6.*
symfony/serializer Version 6.*
symfony/validator Version 6.*
symfony/yaml Version 6.*
symfony/serializer-pack Version ^1.1