Doctrine support for arokettu/uuid
MIT License
arokettu/uuid
arokettu/uuid
column classes and ID generators for Doctrine.
composer require arokettu/uuid-doctrine
doctrine/dbal
v3doctrine/dbal
v4The versions are fully interchangeable except for hard dependency on DBAL.
<?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;
}
Read full documentation for the base library here: https://sandfox.dev/php/uuid.html
Also on Read the Docs: https://arokettu-uuid.readthedocs.io/
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.
The library is available as open source under the terms of the MIT License.