Changeset 8805
- Timestamp:
- 05/06/08 14:16:56 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/generator/sfPropelFormGenerator.class.php
r8804 r8805 334 334 if ($column->isForeignKey()) 335 335 { 336 $options[] = sprintf('\'model\' => \'%s\'', $this->getForeignTable($column)->getPhpName()); 336 $map = call_user_func(array($this->getForeignTable($column)->getPhpName().'Peer', 'getTableMap')); 337 foreach ($map->getColumns() as $primaryKey) 338 { 339 if ($primaryKey->isPrimaryKey()) 340 { 341 break; 342 } 343 } 344 345 $options[] = sprintf('\'model\' => \'%s\', \'column\' => \'%s\'', $this->getForeignTable($column)->getPhpName(), strtolower($primaryKey->getColumnName())); 337 346 } 338 347 else if ($column->isPrimaryKey())