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()
565
565
$ parentColumns = $ parentModel ? array_keys (Doctrine_Core::getTable ($ parentModel )->getColumns ()) : array ();
566
566
567
567
$ columns = array ();
568
+ $ names = array ();
568
569
foreach (array_diff (array_keys ($ this ->table ->getColumns ()), $ parentColumns ) as $ name )
569
570
{
570
571
$ columns [] = new sfDoctrineColumn ($ name , $ this ->table );
572
+ $ names [] = $ name ;
571
573
}
572
574
573
575
// add relations to columns for inherited classes
574
576
if ($ parentModel )
575
577
{
576
578
$ parentRelationNames = array_keys (Doctrine_Core::getTable ($ parentModel )->getRelations ());
577
579
$ relations = $ this ->table ->getRelations ();
578
- $ relationColumns = array ();
579
580
foreach (array_diff (array_keys ($ relations ), $ parentRelationNames ) as $ relationName )
580
581
{
581
582
if (Doctrine_Relation::ONE == $ relations [$ relationName ]->getType ())
582
583
{
583
584
$ columnName = $ relations [$ relationName ]->getLocal ();
584
- if (!in_array ($ columnName , $ relationColumns ))
585
+ if (!in_array ($ columnName , $ names ))
585
586
{
586
- $ relationColumns [] = $ columnName ;
587
587
$ columns [] = new sfDoctrineColumn ($ columnName , $ this ->table );
588
+ $ names [] = $ columnName ;
588
589
}
589
590
}
590
591
}
You can’t perform that action at this time.
0 commit comments