php - Doctrine PreUpdate never worked -


I have searched, and there are so many questions with the same problem, but none of them solves my issue is. / P>

I have a unit, here is the code:

  / * * @ORM \ HasLifecycleClallbacks * / class MyEntity {// Some prints are here ... / * * * @ORM \ column (type = "text", tap = true) * @ esset \ maxelambenth (limit = "500") * / private $ distribution = zero; / ** * @ Dollar Delivery Bull * * Virtual Field which is used for the $ $ Delivery Asset Organization * / Private $ distributionon = false; / ** * @ORM \ preppersist () * @ORM \ PreUpdate () * / Public Function Preset Delivery (if ($ this-> Distribution ON == incorrect) $ this- & gt; Delivery = zero; } / ** * @ORM \ PostLoad () * / Public Function loadDeliveryOn () {If ($ this-> Distribution! = Zero) $ this-> Distributionon = true;}}   

loadDeliveryOn method works completely all the time. But when preset delivery was removed only when I first got the unit I want to say that I am continuing for the database. When the object is updated, but it does not work. And I do not have any ideas.

My Edit Controller:

  Edit Public Function Action ( $ Id) {// Some codes are here ... // ... $ request = $ this-> getRequest (); if ($ request-> method is ('post')) {$ form - & gt; Dam ($ request); if ($ form-> isValid ()) {$ em-> Flush ();}   

Official related preupdate :

passed in the area of ​​entities passed Rtn now use are not recognized by the flush operation, primitive field were passed in the event to modify the values ​​change-set.

If you have access to UnitOfWork , then there is a way to set it as a change?

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -