Wednesday, April 29, 2009

Re: "created" not filling right

After reading over the API and cookbook, I believe both are perfectly
correct (save vs create). Inserting $this->data within the parameter
list of Model::create() is unnecessary in most circumstances, but will
work. I think Model::create() was intended to solve specific issues
that would be difficult to solve with only Model::save().

On Apr 29, 9:43 am, Jon Bennett <jmbenn...@gmail.com> wrote:
> Hi Brendon,
>
> > Why does `cake bake` have that reversed?
>
> > $this->Model->create();    //empty
> > $this->Model->save($this->data);    //filled with sent data
>
> Not sure!
>
> > Also, is Daniel trying to update the found model (if found), or create
> > a new model?  I don't understand the reason for calling $this->Model-
> >>findById($id); in this instance.  I have a feeling that Jon was
> > assuming an additional record created from already existing data
> > within a different record (i.e.: copy), but is that correct?
>
> Indeed, that is [making a duplicate] exactly what I thought was
> happening, perhaps a misleading example was used in the first
> instance?
>
> j
>
> --
>
> jon bennett
> w:http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: