v5:reference:connection:failtrans
failTrans
Description
The method failTrans()
forces a roll back of a smart transaction. The method can be called anywhere inside a transaction scope, but the rollback actually occurs at the point where completeTrans()
is invoked.
Usage
/* * Assume database connection */ $db->startTrans(); /* * some reason to rollback transaction */ $db->failTrans(); /* * Lots more code inside the transaction scope */ $db->completeTrans(); //<---- at this point, the rollback is invoked
v5/reference/connection/failtrans.txt · Last modified: 2016/01/17 00:37 by mnewnham