I have a little problem with the PreUpdate LifecycleCallbacks in Symfony.
I have an entity User with a OneToMany relation with an entity product.
class U
I have got same issue and I have solved it by update $user in preUpdate()
then schedule an extra update:
$args->getEntityManager()->getUnitOfWork()->scheduleExtraUpdate($user, array(
'field_name' => array($oldValue, $newValue)
));
Changing related entities is not allowed using a preUpdate listener.
Changes to associations of the updated entity are never allowed in this event, since Doctrine cannot guarantee to correctly handle referential integrity at this point of the flush operation.
... from the documentation.