Basically, I want to achieve the same thing as ON DUPLICATE KEY in MySQL.
Here's a contrived example:
$rec = array('Foo' => array( 'id' => 999, // Assume there isn't already a record with this id 'website' => 'google' )); $this->Foo->save($rec); // save with different 'website' value $rec['Foo']['website'] = 'stackoverflow'; $this->Foo->save($rec);
Does the last line update the record that was created just a few lines up?