Commit 2e8f73db authored by romanb's avatar romanb

Removed some remainders from the old validation behaviour. This fixes a bug...

Removed some remainders from the old validation behaviour. This fixes a bug where records dont get inserted.
parent 765c06b7
......@@ -56,10 +56,6 @@ class Doctrine_Connection_Transaction implements Countable, IteratorAggregate {
* @var integer $transaction_level the nesting level of transactions, used by transaction methods
*/
private $transaction_level = 0;
/**
* @var Doctrine_Validator $validator transaction validator
*/
private $validator;
/**
* @var array $invalid an array containing all invalid records within this transaction
*/
......@@ -114,8 +110,6 @@ class Doctrine_Connection_Transaction implements Countable, IteratorAggregate {
*/
public function beginTransaction() {
if($this->transaction_level == 0) {
if($this->conn->getAttribute(Doctrine::ATTR_VLD))
$this->validator = new Doctrine_Validator();
if($this->conn->getAttribute(Doctrine::ATTR_LOCKMODE) == Doctrine::LOCK_PESSIMISTIC) {
$this->conn->getAttribute(Doctrine::ATTR_LISTENER)->onPreTransactionBegin($this->conn);
......@@ -177,7 +171,6 @@ class Doctrine_Connection_Transaction implements Countable, IteratorAggregate {
$this->conn->getAttribute(Doctrine::ATTR_LISTENER)->onTransactionCommit($this->conn);
$this->state = Doctrine_Connection_Transaction::STATE_OPEN;
$this->validator = null;
$this->invalid = array();
} elseif($this->transaction_level == 1)
......@@ -258,12 +251,6 @@ class Doctrine_Connection_Transaction implements Countable, IteratorAggregate {
}
endforeach;
if(isset($this->validator)) {
if( ! $this->validator->validateRecord($record)) {
return false;
}
}
$params = array_values($array);
$id = $record->obtainIdentifier();
......@@ -315,12 +302,6 @@ class Doctrine_Connection_Transaction implements Countable, IteratorAggregate {
$array[$name] = $id;
}
if(isset($this->validator)) {
if( ! $this->validator->validateRecord($record)) {
return false;
}
}
$strfields = join(", ", array_keys($array));
$strvalues = substr(str_repeat("?, ",count($array)),0,-2);
$sql = "INSERT INTO ".$record->getTable()->getTableName()." (".$strfields.") VALUES (".$strvalues.")";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment