1
0
mirror of synced 2025-02-17 20:53:18 +03:00
This commit is contained in:
zYne 2007-05-22 18:09:54 +00:00
parent 99037abdad
commit f6bb8c9726
3 changed files with 16 additions and 3 deletions

@ -105,6 +105,16 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
{ {
return $this->_table; return $this->_table;
} }
/**
* setData
*
* @param array $data
* @return Doctrine_Collection
*/
public function setData(array $data)
{
$this->data = $data;
}
/** /**
* this method is automatically called when this Doctrine_Collection is serialized * this method is automatically called when this Doctrine_Collection is serialized
* *

@ -696,7 +696,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
} catch(Doctrine_Adapter_Exception $e) { } catch(Doctrine_Adapter_Exception $e) {
} catch(PDOException $e) { } } catch(PDOException $e) { }
print Doctrine_Lib::formatSql($query);
$this->rethrowException($e); $this->rethrowException($e);
} }
/** /**

@ -488,7 +488,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
foreach($array as $k => $v) { foreach($array as $k => $v) {
$this->$k = $v; $this->$k = $v;
} }
$this->_table->getRepository()->add($this); $this->_table->getRepository()->add($this);
$this->_filter = new Doctrine_Record_Filter($this); $this->_filter = new Doctrine_Record_Filter($this);
@ -825,7 +825,10 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
if ( ! ($value instanceof Doctrine_Collection)) { if ( ! ($value instanceof Doctrine_Collection)) {
throw new Doctrine_Record_Exception("Couldn't call Doctrine::set(), second argument should be an instance of Doctrine_Collection when setting one-to-many references."); throw new Doctrine_Record_Exception("Couldn't call Doctrine::set(), second argument should be an instance of Doctrine_Collection when setting one-to-many references.");
} }
$value->setReference($this,$rel); if (isset($this->_references[$name])) {
$this->_references[$name]->setData($value->getData());
return $this;
}
} else { } else {
// one-to-one relation found // one-to-one relation found
if ( ! ($value instanceof Doctrine_Record)) { if ( ! ($value instanceof Doctrine_Record)) {