1
0
mirror of synced 2025-01-20 07:21:40 +03:00

fixes bug with extended-non-Doctrine_Record tables and makes the relationship parser to fallback to the old method to find keys if it cannot be guessed

This commit is contained in:
runa 2007-06-07 19:20:24 +00:00
parent 42170dd406
commit 7a00232c7a

View File

@ -245,7 +245,11 @@ class Doctrine_Relation_Parser
$conn = $this->_table->getConnection();
foreach ($classes as $class) {
$table = $conn->getTable($class);
try {
$table = $conn->getTable($class);
} catch (Doctrine_Table_Exception $e) {
continue;
}
$columns = $this->getIdentifiers($table);
$found = true;
@ -299,7 +303,11 @@ class Doctrine_Relation_Parser
// try to guess the local key
if ($def['foreign'] === $def['table']->getIdentifier()) {
$def['localKey'] = true;
$def['local'] = $this->guessColumns($foreignClasses, $this->_table);
try {
$def['local'] = $this->guessColumns($foreignClasses, $this->_table);
} catch (Doctrine_Relation_Exception $e) {
$def['local'] = $this->_table->getIdentifier();
}
} else {
$def['local'] = $this->_table->getIdentifier();
}