I figured $this->id would be set when calling read
thanks for the answer.
On Apr 1, 10:44 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 1, 2008 at 5:33 PM, MarcS <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Sorry I'm still being fairly new to cake and I have the follwing
> > problem:
>
> > I'm mass updating some data and use the following code for that
> > $this->Model->findByName("name");
> > $this->Model->save($data);
>
> > when I do that cake is inserting a new record with $data instead of
> > updating the existing one. I guess this is because it doesn't set
> > Model->id after the find operation.
> > Is there any reason why this is not being set?
> > Do I not understand how this is supposed to be done?
>
> Sadly, Cake cannot read your mind and automatically set
> $this->Model->id for you when you do a read.
>
> $data = $this->Model->findByName("name");
> $this->Model->save($data);
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---