Welcome Guest, Not a member yet? Register   Sign In
delete don't work
#3

[eluser]m4rw3r[/eluser]
You end up in an infinite loop: controller -> my_class::delete() -> $message::delete() -> my_class::delete() -> $message::delete() -> ...
This because $message is tied to the my_class model, and according to the Data Mapper pattern is the model responsible for the deletion of the child objects ($message in this case), and you've overwritten the delete method (which $message::delete() calls).

To avoid this, why not just use $this->my_class->find($id)->delete(); ? (Or even AR, when it is so simple?)


Messages In This Thread
delete don't work - by El Forum - 03-08-2009, 04:19 PM
delete don't work - by El Forum - 03-11-2009, 04:04 PM
delete don't work - by El Forum - 03-16-2009, 09:25 AM
delete don't work - by El Forum - 03-22-2009, 03:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB