Well, the short answer is just to use your beforeValidate callback,
and check whatever fields are appropriate.
The long answer... the different validation is based upon the logged
in user, which is authentication and not really related to the model
itself. So you don't want to be reading session values or anything
else in the beforeValidate - it's just a bit messy. The only way I've
done this is to have various flag variables on your model, and set
these in the appropriate controller actions to determine what happens
in the callback. ie:
class YourModel extends AppModel{
var $full_validate=true;
function beforeValidate(){
if ( $this->full_validate ){
// validate the extra fields
}
}
}
and in your controller just set the full_validate variable before your
attempted save.
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---