All pastes #548447 Raw Edit

Something

public text v1 · immutable
·published 2007-06-07 18:50 UTC
rendered paste body
Index: Relation/Parser.php
===================================================================
--- Relation/Parser.php (revision 1596)
+++ Relation/Parser.php (working copy)
@@ -245,7 +245,11 @@
         $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 @@
                 // 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();
                 }