Commit cc01ca46 authored by zYne's avatar zYne

--no commit message

--no commit message
parent 95f53956
...@@ -51,7 +51,7 @@ class Doctrine_Relation_ForeignKey extends Doctrine_Relation ...@@ -51,7 +51,7 @@ class Doctrine_Relation_ForeignKey extends Doctrine_Relation
} }
} }
if ($this->isOneToOne()) { if ($this->isOneToOne()) {
if (empty($id)) { if ( ! $record->exists() || empty($id)) {
$related = $this->getTable()->create(); $related = $this->getTable()->create();
} else { } else {
$dql = 'FROM ' . $this->getTable()->getComponentName() $dql = 'FROM ' . $this->getTable()->getComponentName()
...@@ -65,7 +65,7 @@ class Doctrine_Relation_ForeignKey extends Doctrine_Relation ...@@ -65,7 +65,7 @@ class Doctrine_Relation_ForeignKey extends Doctrine_Relation
} else { } else {
if (empty($id)) { if ( ! $record->exists() || empty($id)) {
$related = new Doctrine_Collection($this->getTable()); $related = new Doctrine_Collection($this->getTable());
} else { } else {
$query = $this->getRelationDql(1); $query = $this->getRelationDql(1);
......
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