Download the PHP package edudobay/doctrine-symfony-serializer without Composer
On this page you can find all versions of the php package edudobay/doctrine-symfony-serializer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download edudobay/doctrine-symfony-serializer
More information about edudobay/doctrine-symfony-serializer
Files in edudobay/doctrine-symfony-serializer
Package doctrine-symfony-serializer
Short Description Map fields in Doctrine ORM using Symfony Serializer
License MIT
Homepage https://github.com/edudobay/doctrine-symfony-serializer
Informations about the package doctrine-symfony-serializer
Mapping fields in Doctrine ORM using Symfony Serializer
This is a proof of concept for a mapping fields with Doctrine ORM so they can be serialized with the Symfony Serializer component, without the need to create a mapping type for each possible data type.
Sometimes you just need to store a complex data type (generally a Value Object) in a JSON field and not worry about database schemas, extra columns or tables, Doctrine embeddables, custom mappings.
Installation
This library requires PHP 8.0 or later.
Usage
See the examples directory for a working code example.
Abridged example
Add this to your application setup:
In your entities, have your domain object as you like, and introduce a private backing field that will make it persistent:
All versions of doctrine-symfony-serializer with dependencies
doctrine/dbal Version ^2.10 || ^3.2 || ^4.0
doctrine/event-manager Version ^1.1 || ^2.0
doctrine/orm Version ^2.12 || ^3.0
phpdocumentor/reflection-docblock Version ^5.3
symfony/property-info Version ^6.0 || ^7.0
symfony/serializer Version ^5.4 || ^6.0 || ^7.0