mediagone / types-common-doctrine
Provides Doctrine types for mediagone/types-common package.
Installs: 3 203
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^7.4|^8.0
- ext-json: *
- ext-mbstring: *
- doctrine/dbal: ^2.7|^3.0|^4.0
- mediagone/types-common: ^0.7.0
Requires (Dev)
- phpunit/phpunit: ^9.0
README
Provides Doctrine types for "mediagone/types-common" package.
Installation
This package requires PHP 7.4+ and Doctrine DBAL 2.7+
Add it as Composer dependency:
$ composer require mediagone/types-common-doctrine
With Symfony
If you're using this package in a Symfony project, register utilized custom types in doctrine.yaml
:
doctrine: dbal: types: app_slug: Mediagone\Doctrine\Types\Common\Text\SlugType ...
Note: app_slug
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\Common\Text\SlugType; Type::addType(SlugType::NAME, SlugType::class); // or, with a custom name: Type::addType('app_slug', SlugType::class);
License
Types Common for Doctrine is licensed under MIT license. See LICENSE file.