You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At first I had tried to write a behavior instead of a trait, but did not manage to do what I wanted.
With a behavior, you cannot override Model::delete(). So the way to do is to catch the beforeDelete event in the behavior, update the soft delete field, and then stop the propagation of the event to avoid the hard deletion to happen. But by doing so, you prevent the cascade deletion to other models as well as counter cache updates, which I think was not satisfactory.
But if you find a way to make all this work with a behavior, feel free to convert it!
For now I see no solution to override the delete()-method. What do you think about implementing this trait into the Utils-plugin to make it easier to use (because you got a big library)...
Hey man,
Am I allowed to convert this awesome trait to a behavior for the Cake 3 Utils Plugin? It would be easier to implement, and could be documented at http://cakemanager.org/docs/utils/1.0/.
Greetz
Bob
The text was updated successfully, but these errors were encountered: