doctrine2 - PreUpdate entity symfony LifecycleCallbacks -


i have little problem preupdate lifecyclecallbacks in symfony.

i have entity user onetomany relation 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 when add or remove product user. when hapends want launch preupdate function make changes in user entity. preupdate not fire when changing entity product user.

thanks lot!!!

changing related entities not allowed using preupdate listener.

changes associations of updated entity never allowed in event, since doctrine cannot guarantee correctly handle referential integrity @ point of flush operation.

... documentation.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -