On Sep 29, 7:30 am, Conrad <[EMAIL PROTECTED]> wrote:
> I am not finding the logic in doing the equiv. of an INSERT query.
>
> I am not seeing how "$this->Model->save($this->data) knows which it
> is, an insert or an update.
>
> Can anyone spell it out for me, Sometimes I think I am somewhat simple
> minded.

where $data is what you pass to save:

if (($this->Model->id === a pk that is in the database) OR
($data[ModelName][id] === a pk that is in the database)) {
    it's an update
} else {
   it's an insert
}

hth,

AD
>
> Conrad


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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