src/mako/database/connections/Connection.php
public function transaction(Closure $queries)
	{
		try
		{
			$this->beginTransaction();

			$returnValue = $queries($this);

			$this->commitTransaction();
		}
		catch(PDOException $e)
		{
			$this->rollBackTransaction();

			throw $e;
		}

		return $returnValue;
	}
public function transaction(Closure $queries)
	{
		try
		{
			$this->beginTransaction();

			$returnValue = $queries($this);

			$this->commitTransaction();
		}
		catch(PDOException $e)
		{
			$this->rollBackTransaction();

			throw $e;
		}

		return $returnValue;
	}
public function transaction ( Closure $ queries ) { try { $ this -> beginTransaction ( ) ; $ returnValue = $ queries ( $ this ) ; $ this -> commitTransaction ( ) ; } catch ( PDOException $ e ) { $ this -> rollBackTransaction ( ) ; throw $ e ; } return $ returnValue ; }
Executes queries and rolls back the transaction if any of them fail.

@param  \Closure      $queries Queries
@throws \PDOException
@return mixed
Executes queries and rolls back the transaction if any of them fail .