Model hooks documentation and examples
Back in the v0.93 docs,the Model tutorial showed (I think) examples of model hooks being used. I can't seem to find a similar example in the new documentation, although the general information about them has increased. The relationships section warns that the on_after_save model will need to have a parent call if it's ever used with an existing relationship, but there's no actual example. Do you think the tutorial should include a hooks example, just to be complete?
I've just been wrestling with the on_after_post() method, trying to change a value and - after scouring this forum - found that method doesn't return the altered $values array, but switching to on_before_clean() does. So the functionality is as I wanted it now, but I think the documentation might explain which hooks can operate on $values for saving, and which don't?
Comments