Commit 4eac440c authored by zYne's avatar zYne

--no commit message

--no commit message
parent ec6120b9
...@@ -300,7 +300,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator ...@@ -300,7 +300,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
*/ */
public function get($key) public function get($key)
{ {
if ($key === null || ! isset($this->data[$key])) { if ( ! isset($this->data[$key])) {
$record = $this->_table->create(); $record = $this->_table->create();
if (isset($this->referenceField)) { if (isset($this->referenceField)) {
...@@ -312,8 +312,11 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator ...@@ -312,8 +312,11 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
$record->set($this->referenceField, $this->reference, false); $record->set($this->referenceField, $this->reference, false);
} }
} }
if ($key === null) {
$this->data[] = $record; $this->data[] = $record;
} else {
$this->data[$key] = $record;
}
return $record; return $record;
} }
......
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