No as long as relevant conditions and fields are present, it will
update as well.

Loke

On Sep 9, 9:55 am, Mukhamad Ikhsan <[email protected]> wrote:
> I have a class model
>
> 1. Shift -> has many ShiftDetail
> 2. ShiftDetail -> belongs to Shift
>
> i was creating page for add Shift that has also can create shift detail on
> the same page (using ajax)
>
> in the controller i using saveAll to save that data,
>
>                 if ($this->Shift->validates()) {
>                     if ($this->Shift->saveAll($this->data, array('validate'
> => 'first')))
>
> and it's work, but the problem is, where i need to update with same approach
> like adding Shift+ShiftDetail
> when i call, $this->Shift->saveAll($this->data.....cake not updated but
> creating new Shift -_-
>
> to locating the culprit, i testing many possibilities, and nothing wrong
> with view/model,
> so i try to change Model->saveAll with Model->save, and voila cake
> understand and updated the data not adding
>
> so i concluding that method saveAll is not for updating but just to creating
> the has many model relationship
>
> http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasM...
>
> on above link, cake not mention about updating the model, so i still
> wandering if it's still can use saveAll for updating the data?
>
> there's someone has creating ticket for similar problem, but the solutions
> is going to (works-for-me)...and still doesn't work for me
>
> http://code.cakephp.org/tickets/view/53
>
> it's anyone has already tried to use saveAll for update data before?
>
> --
> Mukhamad Ikhsan
> Y!id:ikhsan.onlyhttp://www.diodachi.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to