I have a custom model linked to a custom table. In that table, the column sku is unique. I'd like the following code to always update on duplicate:
Mage::getModel('company/product_log')
->setData('sku', 'abc123')
->setData('error', 'Invalid price.')
->save();
I'd like to do this from within the model itself instead of having to repeat update-vs-insert logic everywhere I want to use this table.
What is the best way to do this, or an existing example already in Magento?
product_log
table, and save the model accordingly.