0
votes

Can we wrap multiple model updates in single transaction for a cakephp Controller action.

I found these links which solve this issue.

CakePHP 2.3.x database transaction

How to put begin-commit transaction in controller: cakephp?

But both of them requires code in specific controller-action. Can above solutions be centralized somewhere, so that single global transaction is automatically available to all controllers & actions in application. I'm not able to visualize the solution.

1

1 Answers

0
votes

I'm know sure if i got your question right. I assume you want a specific action in all controllers?

You probably could implement it in AppController like

public function myGlobalAction(){
//dosomemodelstuff();
}