From f2484d1726c6f818f48b158c4c1435bccca3fca4 Mon Sep 17 00:00:00 2001 From: zYne Date: Tue, 22 May 2007 21:05:52 +0000 Subject: [PATCH] --- lib/Doctrine/Access.php | 2 +- lib/Doctrine/Connection.php | 1 - lib/Doctrine/Connection/UnitOfWork.php | 4 ++-- lib/Doctrine/Db/Statement.php | 4 ---- lib/Doctrine/Lib.php | 5 ++--- lib/Doctrine/Record.php | 2 +- lib/Doctrine/Relation.php | 2 +- 7 files changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/Doctrine/Access.php b/lib/Doctrine/Access.php index e290107d1..db7008079 100644 --- a/lib/Doctrine/Access.php +++ b/lib/Doctrine/Access.php @@ -126,7 +126,7 @@ abstract class Doctrine_Access implements ArrayAccess if ( ! isset($offset)) { $this->add($value); } else { - $this->set($offset,$value); + $this->set($offset, $value); } } /** diff --git a/lib/Doctrine/Connection.php b/lib/Doctrine/Connection.php index dfb8705ff..62374f205 100644 --- a/lib/Doctrine/Connection.php +++ b/lib/Doctrine/Connection.php @@ -696,7 +696,6 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun } catch(Doctrine_Adapter_Exception $e) { } catch(PDOException $e) { } - print Doctrine_Lib::formatSql($query); $this->rethrowException($e); } /** diff --git a/lib/Doctrine/Connection/UnitOfWork.php b/lib/Doctrine/Connection/UnitOfWork.php index 02c5c4bb3..05917a582 100644 --- a/lib/Doctrine/Connection/UnitOfWork.php +++ b/lib/Doctrine/Connection/UnitOfWork.php @@ -187,7 +187,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module foreach ($record->getReferences() as $k => $v) { $rel = $record->getTable()->getRelation($k); - if ($rel instanceof Doctrine_Relation_Association) { + if ($rel instanceof Doctrine_Relation_Association) { $v->save($this->conn); $assocTable = $rel->getAssociationTable(); @@ -196,7 +196,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module . ' WHERE ' . $rel->getForeign() . ' = ?' . ' AND ' . $rel->getLocal() . ' = ?'; - $this->query($r->getIncremented(), $record->getIncremented()); + $this->conn->execute($query, array($r->getIncremented(), $record->getIncremented())); } foreach ($v->getInsertDiff() as $r) { $assocRecord = $assocTable->create(); diff --git a/lib/Doctrine/Db/Statement.php b/lib/Doctrine/Db/Statement.php index 3231743d2..a662599a6 100644 --- a/lib/Doctrine/Db/Statement.php +++ b/lib/Doctrine/Db/Statement.php @@ -205,10 +205,6 @@ class Doctrine_Db_Statement implements Doctrine_Adapter_Statement_Interface $skip = $this->adapter->getListener()->onPreExecute($event); if ( ! $skip) { - if (isset($params[0]) && is_array($params[0])) { - print_r($params); - throw new Exception(); - } $this->stmt->execute((array) $params); $this->adapter->incrementQueryCount(); } diff --git a/lib/Doctrine/Lib.php b/lib/Doctrine/Lib.php index a45253cbb..9782238f3 100644 --- a/lib/Doctrine/Lib.php +++ b/lib/Doctrine/Lib.php @@ -239,10 +239,9 @@ class Doctrine_Lib { $r[] = "
";
         $r[] = get_class($collection);
+        $r[] = 'data : ' . Doctrine::dump($collection->getData(), false);
+        //$r[] = 'snapshot : ' . Doctrine::dump($collection->getSnapshot());
 
-        foreach ($collection as $key => $record) {
-            $r[] = "Key : ".$key." ID : ".$record->obtainIdentifier();
-        }
         $r[] = "
"; return implode("\n",$r); } diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index a256a2332..c82174a95 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -1168,7 +1168,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite { if ($id === false) { $this->_id = array(); - $this->_data = $this->_filter->cleanData($this->_data); + $this->_data = $this->_filter->cleanData($this->_data); $this->_state = Doctrine_Record::STATE_TCLEAN; $this->_modified = array(); } elseif ($id === true) { diff --git a/lib/Doctrine/Relation.php b/lib/Doctrine/Relation.php index b04a828f8..ae9405d84 100644 --- a/lib/Doctrine/Relation.php +++ b/lib/Doctrine/Relation.php @@ -54,7 +54,7 @@ abstract class Doctrine_Relation const MANY_COMPOSITE = 3; const ONE = 0; - const MANY = 1; + const MANY = 2; protected $definition = array('alias' => true, 'foreign' => true,