Hi marco!

I use: $this->myModel->validate = Set::merge($this->myModel->validate,
$newValidation); where $newValidation has the new rules to the specific
case. for example:

$newValidation= array('name_of_the_field_in_the_model_validation' =>
array('name_of_validation' => array(    'rule' => VALID_NOT_EMPTY,


    'last' => true)));
With something like this, you modificate on execution time the rule that is
defined in the model.

I hope it can help you. Regards.

2010/6/8 marco.rizze...@gmail.com <marco.rizze...@gmail.com>

> Hi
> I have this need.
> I have to do a model's save with a field that normally can't be empty
> but in this case can be empty.
> How can I do to save doing the validation only on some fields and not
> on others fields?
> Many Thanks
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to