> - If $this->id (in model's beforeSave() callback) is false then you are
> creating record otherwise it has id of record which will be getting updated

Although generally true, this is not always the case. If you specify
the primary key, but that record does not exist, it will be an insert,
but the $model->id will be set.

E.g. there is no `Person` with id=999, and you do

$this->Person->create();
$this->Person->save(array('Person' => array(
  'id' => 999,
  'name' => 'Testy McTest'
));

This will be an INSERT operation. However, inside
Person::beforeSave(), `$this->id` will return 999. `$this->exists()`
will return false.
--~--~---------~--~----~------------~-------~--~----~
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