arokettu / uuid-doctrine
Doctrine support for arokettu/uuid
2.0.6
2024-07-07 23:44 UTC
Requires
- php: ^8.2
- arokettu/is-resource: ^1.0
- arokettu/uuid: ^1.3 | ^2.0 | ^3.0 | ^4.0
- doctrine/dbal: ^4.0
Requires (Dev)
- arokettu/clock: ^2.2
- doctrine/orm: ^3.0
- phpunit/phpunit: ^10.2
- sandfox.dev/code-standard: ^1.2024.07.05
- squizlabs/php_codesniffer: *
- vimeo/psalm: ^5.13
README
arokettu/uuid
column classes and ID generators for Doctrine.
Installation
composer require arokettu/uuid-doctrine
- Version 1.x is for
doctrine/dbal
v3 - Version 2.x is for
doctrine/dbal
v4
The versions are fully interchangeable except for hard dependency on DBAL.
Usage
<?php use Arokettu\Uuid\Doctrine\{UuidType,UuidV4Generator}; use Arokettu\Uuid\Uuid; use Doctrine\ORM\Mapping\{Column,CustomIdGenerator,Entity,GeneratedValue,Id,Table}; #[Entity, Table(name: 'uuid_object')] class UuidObject { #[Column(type: UuidType::NAME)] #[Id, GeneratedValue(strategy: 'CUSTOM'), CustomIdGenerator(UuidV4Generator::class)] public Uuid $id; #[Column(type: UuidType::NAME)] public Uuid $uuidString; }
Documentation
Read full documentation for the base library here: https://sandfox.dev/php/uuid.html
Also on Read the Docs: https://arokettu-uuid.readthedocs.io/
Support
Please file issues on our main repo at GitLab: https://gitlab.com/sandfox/php-uuid/-/issues
Feel free to ask any questions in our room on Gitter: https://gitter.im/arokettu/community
Both 1.x and 2.x versions are actively supported.
License
The library is available as open source under the terms of the MIT License.