> I don't use afterSave, but beforeValidate for two reasons: > * you can use empty($this->id) to check if we are creating/updating > * you can still have validation rules on the 'automaticly filled in > fields' (but, now thinking about it, there is probably something > conceptually wrong with this argument since it is automaticly filled > in)
In this case you could put the work in beforeSave() instead, in order to check the empty($this->id), and to allow the validation to occur normally. My only issue with that is if there is some kind of error when the model performs the save, the work will have completed already - I'd rather not assume that the save will be successful, I'd rather let the save occur and operate off of its success...this goes back to using afterSave() which will only trigger when the save was successful. A quick manual patch in model_php#.php to record whether it was created or updated during the last save would solve this problem. othAuth at Cakeforge: http://cakeforge.org/snippet/detail.php?type=snippet&id=38 othAuth supports user groups, which makes it a little more robust than rdAuth. Users are part of a Group, where the Groups hold the permissions (roles). But rdAuth is great if you don't need the complexity of managing group permissions. I am anxiously awaiting a possible update to othAuth to support "Group/User hasManyBelongsToMany Association" (wink, wink, nudge, nudge). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~----------~----~----~----~------~----~------~--~---
