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
That should work, but increases coupling in the system.
On Feb 6, 2008 5:07 PM, b logica <[EMAIL PROTECTED]> wrote:
>
> On Feb 3, 2008 7:13 AM, cronet <[EMAIL PROTECTED]> wrote:
> >
> > Hello,
> >
> >
> > how realising case by case validation ?? (
On Feb 3, 2008 7:13 AM, cronet <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
>
> how realising case by case validation ?? (e.g. A form need to validate
> different for a user logged in, or not logged in)
>
> First, I thought about creating two different Models with th
x27;on' => 'create' or 'update' rules,
> > but maybe you can sort of extend that to add more states, like 'on' =>
> > 'logged'.
>
> > Cheers,
>
> > On Feb 3, 2008 10:13 AM, cronet <[EMAIL PROTECTED]> wrote:
>
ow cake's implement the 'on' => 'create' or 'update' rules,
> but maybe you can sort of extend that to add more states, like 'on' =>
> 'logged'.
>
> Cheers,
>
>
> On Feb 3, 2008 10:13 AM, cronet <[EMAIL PROTECTE
' =>
'logged'.
Cheers,
On Feb 3, 2008 10:13 AM, cronet <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
>
> how realising case by case validation ?? (e.g. A form need to validate
> different for a user logged in, or not logged in)
>
> First, I thought about cre
Hello,
how realising case by case validation ?? (e.g. A form need to validate
different for a user logged in, or not logged in)
First, I thought about creating two different Models with the
different validation cases.
But what about the funcitons I need for the models which I would pack
in the