8000 [Uid] Use ::class to reference id generator services · xelaris/symfony-docs@92b03f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 92b03f8

Browse files
authored
[Uid] Use ::class to reference id generator services
1 parent eec7f40 commit 92b03f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/uid.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ entity primary keys::
257257
namespace App\Entity;
258258

259259
use Doctrine\ORM\Mapping as ORM;
260+
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
260261
use Symfony\Bridge\Doctrine\Types\UuidType;
261262
use Symfony\Component\Uid\Uuid;
262263

@@ -265,7 +266,7 @@ entity primary keys::
265266
#[ORM\Id]
266267
#[ORM\Column(type: UuidType::NAME, unique: true)]
267268
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
268-
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
269+
#[ORM\CustomIdGenerator(class: UuidGenerator::class)]
269270
private ?Uuid $id;
270271

271272
public function getId(): ?Uuid
@@ -444,6 +445,7 @@ entity primary keys::
444445
namespace App\Entity;
445446

446447
use Doctrine\ORM\Mapping as ORM;
448+
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
447449
use Symfony\Bridge\Doctrine\Types\UlidType;
448450
use Symfony\Component\Uid\Ulid;
449451

@@ -452,7 +454,7 @@ entity primary keys::
452454
#[ORM\Id]
453455
#[ORM\Column(type: UlidType::NAME, unique: true)]
454456
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
455-
#[ORM\CustomIdGenerator(class: 'doctrine.ulid_generator')]
457+
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
456458
private ?Ulid $id;
457459

458460
public function getId(): ?Ulid

0 commit comments

Comments
 (0)
0