kaigrassnick/doctrine-snowflake-bundle

此Bundle为Doctrine提供Snowflake-ID生成器

1.0.3 2021-01-28 08:32 UTC

This package is auto-updated.

Last update: 2024-08-28 14:48:07 UTC


README

此bundle为Doctrine提供了一个简单的Snowflake ID生成器。

如何使用

在您的实体中使用自定义策略

    /**
     * @var string
     *
     * @ORM\Id()
     * @ORM\GeneratedValue(strategy="CUSTOM")
     * @ORM\Column(type="bigint", unique=true, nullable=false)
     * @ORM\CustomIdGenerator(class="KaiGrassnick\DoctrineSnowflakeBundle\Generator\SnowflakeGenerator")
     */
    private string $id;