What if the saveAll is called from the parent model rather than from the actual model itself?
nope, i am not passing anything other than $data. On Jan 11, 7:56 pm, Amit Badkas <[email protected]> wrote: > Hi, > > The saveAll() internally calls save(), that's why I suggested to use > beforeSave(). Are you passing any option to saveAll() other than data? > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com > > > > > > > > On Tue, Jan 11, 2011 at 5:11 PM, Zeu5 <[email protected]> wrote: > > Thank you Amit, but the same issue arises. > > > in a saveAll, the fields are not directly at ['model_alias'] > > ['field_name'] > > > so changing it to beforeSave would not help. > > > I am not sure if i have made myself clear enough. > > > On Jan 11, 7:36 pm, Amit Badkas <[email protected]> wrote: > > > 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 <[email protected]> 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 sitehttp://cakeqs.organdhelp > > 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 [email protected] > > > > To unsubscribe from this group, send email to > > > > [email protected]<cake-php%[email protected] > > > > om> > > <cake-php%[email protected] om>For more options, visit this > > group at > > > >http://groups.google.com/group/cake-php?hl=en > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 [email protected] > > To unsubscribe from this group, send email to > > [email protected]<cake-php%[email protected] > > om>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 [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
