mediagone / types-france-doctrine
Provides Doctrine types for mediagone/types-france package.
0.1.3
2022-02-14 16:12 UTC
Requires
- php: ^7.4|^8.0
- ext-json: *
- ext-mbstring: *
- doctrine/dbal: ^2.7|^3.0
- mediagone/types-france: ^0.1
Requires (Dev)
- phpunit/phpunit: ^9.0
README
Provides Doctrine types for "mediagone/types-france" package.
Installation
This package requires PHP 7.4+ and Doctrine DBAL 2.7+
Add it as Composer dependency:
$ composer require mediagone/types-france-doctrine
With Symfony
If you're using this package in a Symfony project, register utilized custom types in doctrine.yaml
:
doctrine: dbal: types: app_postalcode: Mediagone\Doctrine\Types\France\Geo\PostalCodeType ...
Note: app_postalcode
being the type name you'll use in your Entity mappings, you can pick whatever name you wish.
As standalone
Custom types can also be used separately, but need to be registered in Doctrine DBAL like this:
use Doctrine\DBAL\Types\Type; use Mediagone\Doctrine\Types\France\Geo\PostalCodeType; Type::addType(PostalCodeType::NAME, PostalCodeType::class); // or, with a custom name: Type::addType('app_postalcode', PostalCodeType::class);
License
Types France for Doctrine is licensed under MIT license. See LICENSE file.