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::
141
141
142
142
// there are generators for UUID V1 and V6 too
143
143
use Symfony\Bridge\Doctrine\IdGenerator\UuidV4Generator;
144
+ use Symfony\Component\Uid\Uuid;
144
145
145
146
/**
146
147
* @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
@@ -156,6 +157,13 @@ entity primary keys::
156
157
private $id;
157
158
158
159
// ...
160
+
161
+ public function getId(): ?Uuid
162
+ {
163
+ return $this->id;
164
+ }
165
+
166
+ // ...
159
167
}
160
168
161
169
.. versionadded :: 5.2
@@ -279,6 +287,7 @@ There's also a Doctrine generator to help autogenerate ULID values for the
279
287
entity primary keys::
280
288
281
289
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
290
+ use Symfony\Component\Uid\Ulid;
282
291
283
292
/**
284
293
* @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
@@ -294,6 +303,14 @@ entity primary keys::
294
303
private $id;
295
304
296
305
// ...
306
+
307
+ public function getId(): ?Ulid
308
+ {
309
+ return $this->id;
310
+ }
311
+
312
+ // ...
313
+
297
314
}
298
315
299
316
.. versionadded :: 5.2
You can’t perform that action at this time.
0 commit comments