I have oneToMany bidirectional relationship between User and Address. In yml file, do I need to specify the user_id field for Address entity? I did that and when I generated entity getters it didn’t create getUser() or setUser() instead getUserId() and setUserId()
I have oneToMany bidirectional relationship between User and Address. In yml file, do I
Share
On your
Addressentity you would have a$userfield relating to aUserentity, notuser_idrelating to aninteger.Remember you are mapping in terms of entities with Doctrine, not SQL or relational database tables. Try to think in terms of your business model as much as possible, Doctrine will handle the rest and internally it will know to make a foreign key related to a user id in the
addresstable.User mapping:
Address mapping