File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
lib/plugins/sfDoctrinePlugin/lib/generator Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -565,26 +565,27 @@ public function getColumns()
565565 $ parentColumns = $ parentModel ? array_keys (Doctrine_Core::getTable ($ parentModel )->getColumns ()) : array ();
566566
567567 $ columns = array ();
568+ $ names = array ();
568569 foreach (array_diff (array_keys ($ this ->table ->getColumns ()), $ parentColumns ) as $ name )
569570 {
570571 $ columns [] = new sfDoctrineColumn ($ name , $ this ->table );
572+ $ names [] = $ name ;
571573 }
572574
573575 // add relations to columns for inherited classes
574576 if ($ parentModel )
575577 {
576578 $ parentRelationNames = array_keys (Doctrine_Core::getTable ($ parentModel )->getRelations ());
577579 $ relations = $ this ->table ->getRelations ();
578- $ relationColumns = array ();
579580 foreach (array_diff (array_keys ($ relations ), $ parentRelationNames ) as $ relationName )
580581 {
581582 if (Doctrine_Relation::ONE == $ relations [$ relationName ]->getType ())
582583 {
583584 $ columnName = $ relations [$ relationName ]->getLocal ();
584- if (!in_array ($ columnName , $ relationColumns ))
585+ if (!in_array ($ columnName , $ names ))
585586 {
586- $ relationColumns [] = $ columnName ;
587587 $ columns [] = new sfDoctrineColumn ($ columnName , $ this ->table );
588+ $ names [] = $ columnName ;
588589 }
589590 }
590591 }
You can’t perform that action at this time.
0 commit comments