Reputation: 2167
Description: I have an User entity, which has a Profile entity.
Problem:
I call:
$entityManager->flush($user);
But the User doesn't have any property changed, only it's Profile is changed.
Everything works if I call:
Note: Without the object itself. I do not really want to do it without an object as argument, since I might flush some other changes in other entities, which I am not aware of at that particular moment. Looks like when someone calls the flush method with an object as argument, it is not aware of cascading the persistence. Any ideas how to solve this?
Upvotes: 2
Views: 7296
Reputation: 1815
Due you are modifying the profile and not the user you should use:
$entityManager->flush($profile);
Upvotes: 5