1
0
mirror of synced 2025-01-18 22:41:43 +03:00
This commit is contained in:
zYne 2007-05-23 21:49:27 +00:00
parent e922ae7689
commit e3e001efbc

View File

@ -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());