File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ entity primary keys::
141141
142142 // there are generators for UUID V1 and V6 too
143143 use Symfony\Bridge\Doctrine\IdGenerator\UuidV4Generator;
144+ use Symfony\Component\Uid\Uuid;
144145
145146 /**
146147 * @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
@@ -156,6 +157,13 @@ entity primary keys::
156157 private $id;
157158
158159 // ...
160+
161+ public function getId(): ?Uuid
162+ {
163+ return $this->id;
164+ }
165+
166+ // ...
159167 }
160168
161169.. versionadded :: 5.2
@@ -279,6 +287,7 @@ There's also a Doctrine generator to help autogenerate ULID values for the
279287entity primary keys::
280288
281289 use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
290+ use Symfony\Component\Uid\Ulid;
282291
283292 /**
284293 * @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
@@ -294,6 +303,14 @@ entity primary keys::
294303 private $id;
295304
296305 // ...
306+
307+ public function getId(): ?Ulid
308+ {
309+ return $this->id;
310+ }
311+
312+ // ...
313+
297314 }
298315
299316.. versionadded :: 5.2
You can’t perform that action at this time.
0 commit comments