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 User{
/**
* @ORM\OneToMany(targetEntity="Product", mappedBy="formulario", cascade={"persist", "remove"})
*/
private $products;
}
class Product{
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="products")
* @ORM\JoinColumn(name="user", referencedColumnName="id")
*/
private $user;
}
My problem is when I add or remove a product from the User. When this hapends I want to launch a PreUpdate function to make some changes in the User Entity. But the PreUpdate is not fire when changing the entity Product from the User.
Thanks a lot!!!