You may need to update your question to add some code because at the moment we are all guessing.
Here is a simple example of how save() works in a mapper, using an entity model in place of an array.
public function saveArtist(Music_Model_Artist $artist)
{
//if id is set fetch the row
if (!is_null($artist->id)) {
$select = $this->getGateway()->select();
$select->where('id = ?', $artist->id);
$row = $this->getGateway()->fetchRow($select);
} else {
//if id is not set create a new row
$row = $this->getGateway()->createRow();
}
// this data is added to the record always
$row->name = $artist->name;
//save/update the row
$row->save();
//return the whole row, my preference as save() just returns primary key of row.
return $row;
}
What really happens is if you submit an existing row save()
will UPDATE if you create a new row save()
will INSERT. There is no magic in this method you control what it does based on the data passed to it. Be specific and it works great.
Your app appears to be doing an INSERT when you intend for it to be doing an UPDATE.