tomazahlin
tomazahlin

Reputation: 2167

Doctrine2 entity manager flush not updating the associated entities

Description: I have an User entity, which has a Profile entity.

Problem:

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

Answers (1)

Hpatoio
Hpatoio

Reputation: 1815

Due you are modifying the profile and not the user you should use:

$entityManager->flush($profile);

Upvotes: 5

Related Questions