1
0
mirror of synced 2025-01-18 14:31:40 +03:00

Fixes for composite keys giving error.

This commit is contained in:
Jonathan.Wage 2007-10-09 01:34:36 +00:00
parent fe34a0d29f
commit dd71ec4b06

View File

@ -121,7 +121,14 @@ class Doctrine_Data_Import extends Doctrine_Data
}
}
$obj->save();
$identifier = is_array($obj->getTable()->getIdentifier()) ? $obj->getTable()->getIdentifier():array($obj->getTable()->getIdentifier());
// We only want to save the record if it is a single primary key.
// We can't save the composite primary key because neither of the foreign keys have been created yet
// We will satisfy these relationships later and save the record.
if (count($identifier) === 1) {
$obj->save();
}
$primaryKeys[$rowKey] = $obj->identifier();
}