This commit is contained in:
parent
e922ae7689
commit
e3e001efbc
1 changed files with 5 additions and 2 deletions
|
@ -45,7 +45,10 @@ class Doctrine_Relation_ForeignKey extends Doctrine_Relation
|
|||
{
|
||||
$id = array();
|
||||
foreach ((array) $this->definition['local'] as $local) {
|
||||
$id[] = $record->get($local);
|
||||
$value = $record->get($local);
|
||||
if (isset($value)) {
|
||||
$id[] = $value;
|
||||
}
|
||||
}
|
||||
if ($this->isOneToOne()) {
|
||||
if (empty($id)) {
|
||||
|
@ -60,7 +63,7 @@ class Doctrine_Relation_ForeignKey extends Doctrine_Relation
|
|||
|
||||
$related->set($this->definition['foreign'], $record, false);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
if (empty($id)) {
|
||||
$related = new Doctrine_Collection($this->getTable());
|
||||
|
|
Loading…
Add table
Reference in a new issue