mediagone / small-uid-doctrine
Provides Doctrine types for mediagone/small-uid package.
0.6.2
2021-05-03 10:55 UTC
Requires
- php-64bit: ^7.4|^8.0
- ext-gmp: *
- doctrine/dbal: ^2.7
- mediagone/small-uid: ^0.6
Requires (Dev)
- phpunit/phpunit: ^9.0
README
⚠️ This project is in experimental phase, the API may change any time.
Provides Doctrine types for mediagone/small-uid
package:
SmallUidType
: binary (8 bytes)
Installation
This package requires PHP (64-bit) 7.4+ and Doctrine DBAL 2.7+
Add it as Composer dependency:
$ composer require mediagone/small-uid-doctrine
With Symfony
If you're using this package in a Symfony project, register Small UID custom type in doctrine.yaml:
doctrine: dbal: types: smalluid: Mediagone\SmallUid\Doctrine\SmallUidType
Note: smalluid
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\SmallUid\Doctrine\SmallUidType; Type::addType(SmallUidType::NAME, SmallUidType::class); // or, with a custom name: Type::addType('smalluid', SmallUidType::class);
License
Small UID for Doctrine is licensed under MIT license. See LICENSE file.