[CakePHP 2.x]トランザクション
各Model内
/* トランザクションスタート */ $dataSource=$this->getDataSource(); $result=$dataSource->begin(); /* コミット */ $result=$dataSource->commit(); /* ロールバック */ $result=$dataSource->rollback();
AppModel.phpに下記のようにするのもいいかもね。
public function begin(){ return $this->getDataSource()->begin(); } public function commit(){ return $this->getDataSource()->commit(); } public function rollback(){ return $this->getDataSource()->rollback(); }