Hello guys!
I'm fighting with a problem for a considerable time, and I can't find a nice way to fix my issue.
Let's say I have two tables:
uses (id, name)
uses_phone (id, user_id, phone)
Supposing I have created a users (1, 'Mary')
and her phones users_phones (1, 1, '123') (2, 1, '333')
If I want to update Mary, to change her name to "Maria":
The save()
method will NOT delete the actual records in users_phone
, but will insert
new entries, and then I will have:
1, 1, 123
2, 1, 333
3, 1, 123
4, 1, 333
Which is the best way to solve this issue? I'm a bit confused. I like using Model instead PHQL (I like it too, but Models with ODM seems quie magic).
Thanks for reading and please forgive my bad English.