File tree Expand file tree Collapse file tree 1 file changed +1
-31
lines changed Expand file tree Collapse file tree 1 file changed +1
-31
lines changed Original file line number Diff line number Diff line change @@ -151,39 +151,9 @@ type, which converts to/from UUID objects automatically::
151
151
// ...
152
152
}
153
153
154
- There's also a Doctrine generator to help autogenerate UUID values for the
155
- entity primary keys::
156
-
157
- // there are generators for UUID V1 and V6 too
158
- use Symfony\Bridge\Doctrine\IdGenerator\UuidV4Generator;
159
- use Symfony\Component\Uid\Uuid;
160
-
161
- /**
162
- * @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
163
- */
164
- class Product
165
- {
166
- /**
167
- * @ORM\Id
168
- * @ORM\Column(type="uuid", unique=true)
169
- * @ORM\GeneratedValue(strategy="CUSTOM")
170
- * @ORM\CustomIdGenerator(class=UuidV4Generator::class)
171
- */
172
- private $id;
173
-
174
- // ...
175
-
176
- public function getId(): ?Uuid
177
- {
178
- return $this->id;
179
- }
180
-
181
- // ...
182
- }
183
-
184
154
.. versionadded :: 5.2
185
155
186
- The UUID type and generators were introduced in Symfony 5.2.
156
+ The UUID type was introduced in Symfony 5.2.
187
157
188
158
When using built-in Doctrine repository methods (e.g. ``findOneBy() ``), Doctrine
189
159
knows how to convert these UUID types to build the SQL query
You can’t perform that action at this time.
0 commit comments