Changeset 981 for trunk

Show
Ignore:
Timestamp:
02/28/08 02:59:23 (9 months ago)
Author:
apinstein
Message:

patch graphviz task due to bug with non-existant function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/generator/classes/propel/phing/PropelGraphvizTask.php

    r833 r981  
    147147 
    148148                                        foreach ($tbl->getColumns() as $col) { 
    149                                                 $fk = $col->getForeignKey(); 
    150                                                 if ( $fk == null ) continue; 
    151                                                 $dotSyntax .= 'node'.$tbl->getName() .':cols -> node'.$fk->getForeignTableName() . ':table [label="' . $col->getName() . '=' . implode(',', $fk->getForeignColumns()) . ' "];'; 
    152                                                 $dotSyntax .= "\n"; 
     149                        $fk = $col->getForeignKeys(); 
     150                        if ( count($fk) == 0 or $fk === null ) continue; 
     151                        if ( count($fk) > 1 ) throw( new Exception("not sure what to do here...") ); 
     152                        $fk = $fk[0];   // try first one 
     153                        $dotSyntax .= 'node'.$tbl->getName() .':cols -> node'.$fk->getForeignTableName() . ':table [label="' . $col->getName() . '=' . implode(',', $fk->getForeignColumns()) . ' "];'; 
     154                        $dotSyntax .= "\n"; 
    153155                                        } 
    154156                                }