Using Symfon2.0 and Doctrine, I am trying to do the following:
- Insert a new row in the database
- in the moment of inserting, automatically generate a code and also insert it.
- That code is related to the ID of the table. Something like
<something>/row_id
How can I easily do this?
I've been trying Doctrine Livecycle callbacks. But:
- PrePersist still doesn't have the ID.
- PostPersist have the ID, but somehow the insertion has already been done and, although I can set any property from the Entity, I don't know how to make it to be persisted "again" to the database.
Any clue overthere?
Any other way to do it properly?