Transaction in cakephp 1.3

In my controller:

$dataSource = $this->getDataSource(); // line 141
$dataSource->begin($this);
if(...){
   $dataSource->commit($this);
}else{
   $dataSource->rollback($this);
}

but does not work, I get the following error:

Fatal error: calling the undefined method AppusuariosController :: getDataSource () in C: ... \ app \ controllers \ appusuarios_controller.php on line 141

Do I need to import getDataSource ()?

+3
source share
1 answer

I found a solution, hope this helps someone in the future http://www.amitrawat.com/2011/08/30/transaction-cakephp/

+2
source

All Articles