Download the PHP package aboutcoders/enum-serializer-bundle without Composer
On this page you can find all versions of the php package aboutcoders/enum-serializer-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aboutcoders/enum-serializer-bundle
More information about aboutcoders/enum-serializer-bundle
Files in aboutcoders/enum-serializer-bundle
Package enum-serializer-bundle
Short Description A symfony bundle to serialize/deserialize enumerations of type myclabs/php-enum with jms/serializer
License MIT
Homepage http://aboutcoders.com
Informations about the package enum-serializer-bundle
AbcEnumSerializerBundle
A symfony bundle to serialize/deserialize enumerations of type myclabs/php-enum with jms/serializer.
Note: At this point json
is the only supported format.
Installation
Add the AbcEnumSerializerBundle to your composer.json
file:
Include the bundle in the AppKernel.php class:
Usage
Define the enum as defined by myclabs/php-enum:
In order to serialize/deserialize the enumeration you can register the type in app/config.yml
or you can register the enum within the service container and tag it with with the tag abc.enum
Note, this service should be declared private and should never be instantiated, since this would lead to an exception. The only purpose of this service is to provide the fully qualified name of the class that needs to be registered as enum type.
Finally you can configure the type in case you use it as a member variable
or serialize/deserialize it directly referencing the type:
ToDo
- Add support for the formats XML and YAML
All versions of enum-serializer-bundle with dependencies
myclabs/php-enum Version ~1.4
jms/serializer-bundle Version ~1.0|~2.0|~3.0
symfony/dependency-injection Version ^3.3 || ^4.0 || ^5.0
symfony/framework-bundle Version ^3.0 || ^4.0 || ^5.0