I need your help using transactions in CakePHP.
I have a Product model, with clause hasMany to Price and Property models (key product_id).
In my Product model,
Tables must be in InnoDb format. MyISAM format of tables doesn't support transactions.
No need to insert additional code into model.
ProductController:
$datasource = $this->Product->getDataSource();
try {
$datasource->begin();
if(!$this->Product->save($data)
throw new Exception();
if(!$this->Price->save($data_one)
throw new Exception();
if(!$this->Property->save($my_data)
throw new Exception();
$datasource->commit();
} catch(Exception $e) {
$datasource->rollback();
}