I have a model "m". I want to execute some public static function every time I change the "update" page of the model "m". How can I do that?
My model "m" has many models "m2". I need the "id" of my model "m" to create a model "m2", so, I created the model "m" empty and I redirected to the "update" page of the model "m" to create the models "m2" with no problems (because in this point, I have the id of the model "m"). The problem is if I decide to close the web application or change to another page (without finish the "update"), the model "m" remains saved "empty" in the database (of course), so I need to delete that model if I change the "update" page and if the model "m" is empty.
With "model empty" I mean the model saved with id but no other attribute filled.
thank you very much, but that would be a lot of change in what I already have done in the “views”, I’m working with a web designer and I cannot do changes in the “views” without asking her and your solution requires a lot of changes in the “views”…