UlidGenerator.php 584 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bridge\Doctrine\IdGenerator;
  11. use Doctrine\ORM\EntityManager;
  12. use Doctrine\ORM\Id\AbstractIdGenerator;
  13. use Symfony\Component\Uid\Ulid;
  14. /**
  15. * @experimental in 5.2
  16. */
  17. final class UlidGenerator extends AbstractIdGenerator
  18. {
  19. public function generate(EntityManager $em, $entity): Ulid
  20. {
  21. return new Ulid();
  22. }
  23. }