cycle/entity-macros-uuid

提供使用 ramsey/uuid 作为 Cycle ORM 实体列类型的能力

1.2.0 2024-02-08 19:43 UTC

This package is auto-updated.

Last update: 2024-09-19 20:01:22 UTC


README

Latest Stable Version Build Status Scrutinizer Code Quality Codecov

此包提供使用 ramsey/uuid 作为 Cycle ORM 实体列类型的能力。

安装

使用 Composer 将此包作为依赖项安装。

composer require cycle/entity-behavior-uuid

示例

它们是随机生成的,不包含有关它们创建的时间和生成它们的机器的任何信息。

use Cycle\Annotated\Annotation\Column;
use Cycle\Annotated\Annotation\Entity;
use Cycle\ORM\Entity\Behavior\Uuid\Uuid4;
use Ramsey\Uuid\UuidInterface;

#[Entity]
#[Uuid4]
class User
{
    #[Column(field: 'uuid', type: 'uuid', primary: true)]
    private UuidInterface $uuid;
}

有关实体行为 UUID 的更多信息,请在此处查看。

许可证

MIT 许可证(MIT)。请参阅LICENSE以获取更多信息。由 Spiral Scout 维护。