Description: I have an User entity, which has a Profile entity.
Problem:
- I load User from database, and change only some property in it's Profile.
I call:
$entityManager->flush($user);
But the User doesn't have any property changed, only it's Profile is changed.
- I have set the cascade={"persist"} on the profile property inside user object.
Everything works if I call:
- $entityManager->flush();
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?
$entityManager->flush($profile);
? – Hpatoio$user
so it doesn't perform any action on persist. – Hpatoio