I was creating a bugfix and decided to write a safe database ORM transactions extension.
To start a transaction, you only have to call from the model
To end a transaction, you only have to call from the model
To rollback, you only have to call
The beauty of this is that you don't accidentally commit a transaction if a different function started a transaction before.
https:// gist.github.com/sigginet/541a8c12d7ec30f6d2f2 (I can only post 2 links in a post as a new user ... but this is only 1 link? - @shadowhand can you fix the link for me? )
Any comments / tips / obvious bugs?