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
Post a Comment