Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

transaction in cakephp 1.3

I have in my controller:

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

but not works, I get the following error:

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

I have to import getDataSource() ?

like image 595
Jonathan García Avatar asked May 07 '26 01:05

Jonathan García


1 Answers

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

like image 120
Jonathan García Avatar answered May 10 '26 10:05

Jonathan García



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!