Should i pass uuid into a id variable in the entity constructor?
PaYo90 opened this issue · 1 comments
PaYo90 commented
In regular uuid we do that. with uuid-doctrine, i dont know if should i do that. Documentattion says nothing about this, but when i try to inicialize entity in the controller, and give a ID value of that entity in the next entity before flush, the ID isEmpty. What should i write, now?
Saeven commented
If you're using the UUID as an ID, you can use the UuidBinaryType with @GeneratedValue - works very well. If you are otherwise using the popular public-id-with-private-uuid method, then Doctrine supports only one @GeneratedValue. You'll put @GeneratedValue on your @Orm\Id integer, and you can push the UUID into the constructor, or assume it within the constructor. YMMV.