public static function transactional($fn)
    {
        $oosql = self::getInstance('oosql', 'void');
        if (!$oosql->beginTransaction()) {
            $msg = 'Could not start this transaction. BeginTransaction failed!';
            throw new \Exception($msg, 9815, null);
        }
        if (is_callable($fn)) {
            $ret = $fn($oosql);
            return $ret;
        }
        $msg = 'Please pass a Lamda function as a parameter to this method!';
        throw new \Exception($msg, 9816, null);
    }
public static function transactional($fn)
    {
        $oosql = self::getInstance('oosql', 'void');
        if (!$oosql->beginTransaction()) {
            $msg = 'Could not start this transaction. BeginTransaction failed!';
            throw new \Exception($msg, 9815, null);
        }
        if (is_callable($fn)) {
            $ret = $fn($oosql);
            return $ret;
        }
        $msg = 'Please pass a Lamda function as a parameter to this method!';
        throw new \Exception($msg, 9816, null);
    }
public static function transactional ( $ fn ) { $ oosql = self :: getInstance ( 'oosql' , 'void' ) ; if ( ! $ oosql -> beginTransaction ( ) ) { $ msg = 'Could not start this transaction. BeginTransaction failed!' ; throw new \ Exception ( $ msg , 9815 , null ) ; } if ( is_callable ( $ fn ) ) { $ ret = $ fn ( $ oosql ) ; return $ ret ; } $ msg = 'Please pass a Lamda function as a parameter to this method!' ; throw new \ Exception ( $ msg , 9816 , null ) ; }
Starts a transaction if current driver supports it
@param callable $fn A Closure
@throws \Exception
@return mixed Whatever the Closure returns is passed to the higher scope variable if any
Starts a transaction if current driver supports it