Skip to content

Commit

Permalink
Added explicit configuration methods to TransactionBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Aug 23, 2014
1 parent 6fa6002 commit 6a33b6a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/Doctrine/DBAL/TransactionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/
class TransactionBuilder
{
const ISOLATION_LEVEL = 'dbal.isolation-level';

/**
* The transaction manager.
*
Expand All @@ -32,20 +34,30 @@ public function __construct(TransactionManager $manager)
}

/**
* Sets the isolation level for this transaction.
* Sets a configuration variable.
*
* @param string $configurationName The configuration variable name.
* @param string $configurationValue The configuration value.
*
* @return \Doctrine\DBAL\TransactionBuilder The current instance for chaining.
*/
public function with($configurationName, $configurationValue)
protected function with($configurationName, $configurationValue)
{
$this->configuration[$configurationName] = $configurationValue;

return $this;
}

/**
* @param integer $isolationLevel
*
* @return \Doctrine\DBAL\TransactionBuilder
*/
public function withIsolationLevel($isolationLevel)
{
return $this->with(self::ISOLATION_LEVEL, $isolationLevel);
}

/**
* Begins the transaction and returns the associated Transaction object.
*
Expand Down

0 comments on commit 6a33b6a

Please sign in to comment.