Commit 7a00232c authored by runa's avatar runa

fixes bug with extended-non-Doctrine_Record tables and makes the relationship...

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
parent 42170dd4
......@@ -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();
}
......
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