Hi,

I think you need to try beforeSave() instead of beforeValidate(), hope it
may work.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Tue, Jan 11, 2011 at 5:02 PM, Zeu5 <kimc...@gmail.com> wrote:

> let say my model Link has 3 fields
> route, model, action,
>
> what I want is that route is the combination of model and action.
>
> eg
> model = '/orders/view/';
> action = '3';
>
> so route is '/orders/view/3';
>
> i did this in my beforeValidate
>
> if (isset($this->data['Link']['model']) && isset($this->data['Link']
> ['action'])) {
>                        $this->data['Link']['route'] =
> $this->data['Link']['model'] . $this-
> >data['Link']['action'];
> }
>
> now the problem is when i do a saveAll, this will not work.
>
> because the data will be
>
> Array(
>        [Link] => Array(
>               [0] => Array(
>                     [id] => 3,
>                     [model]=>'/orders/view/',
>                     [action]=>'3'
>               )
>        )
> )
>
> Please advise.
>
> 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