Using cake's automagic, you could add to your model's beforeSave()
method, doing this:

1) Save a temp copy of $this->validate
2) Create and assign a new version of $this->validate, based on the
state (create vs update)
3) Get the return value of $this->validates() - a true return value
means you validated, false means you did not
4) Reset your copy of $this->validate
5) Return the value saved earlier of $this->validates()

Steps 1 and 4 are totally optional; I'd do them in case there was a
base set of validations you always before, and then you want to add
additional validations based on the model state at the time of saving/
updating.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to