PreUpdate entity symfony LifecycleCallbacks

前端 未结 2 2058
臣服心动
臣服心动 2021-01-26 11:24

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         


        
2条回答
  •  无人共我
    2021-01-26 11:55

    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.

提交回复
热议问题