Changeset 8384
- Timestamp:
- 04/10/08 15:59:46 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormGeneratedTemplate.php
r7147 r8384 18 18 <?php endforeach; ?> 19 19 <?php foreach ($this->getManyToManyTables() as $tables): ?> 20 '<?php echo $tables[' relatedTable']->getName() ?>_list'<?php echo str_repeat(' ', $this->getColumnNameMaxLength() - strlen($tables['relatedTable']->getName().'_list')) ?> => new sfWidgetFormPropelSelectMany(array('model' => '<?php echo $tables['relatedTable']->getPhpName() ?>')),20 '<?php echo $tables['middleTable']->getName() ?>_list'<?php echo str_repeat(' ', $this->getColumnNameMaxLength() - strlen($tables['middleTable']->getName().'_list')) ?> => new sfWidgetFormPropelSelectMany(array('model' => '<?php echo $tables['relatedTable']->getPhpName() ?>')), 21 21 <?php endforeach; ?> 22 22 )); … … 27 27 <?php endforeach; ?> 28 28 <?php foreach ($this->getManyToManyTables() as $tables): ?> 29 '<?php echo $tables[' relatedTable']->getName() ?>_list'<?php echo str_repeat(' ', $this->getColumnNameMaxLength() - strlen($tables['relatedTable']->getName().'_list')) ?> => new sfValidatorPropelChoiceMany(array('model' => '<?php echo $tables['relatedTable']->getPhpName() ?>', 'required' => false)),29 '<?php echo $tables['middleTable']->getName() ?>_list'<?php echo str_repeat(' ', $this->getColumnNameMaxLength() - strlen($tables['middleTable']->getName().'_list')) ?> => new sfValidatorPropelChoiceMany(array('model' => '<?php echo $tables['relatedTable']->getPhpName() ?>', 'required' => false)), 30 30 <?php endforeach; ?> 31 31 )); … … 61 61 62 62 <?php foreach ($this->getManyToManyTables() as $tables): ?> 63 if (isset($this->widgetSchema['<?php echo $tables[' relatedTable']->getName() ?>_list']))63 if (isset($this->widgetSchema['<?php echo $tables['middleTable']->getName() ?>_list'])) 64 64 { 65 65 $values = array(); … … 69 69 } 70 70 71 $this->setDefault('<?php echo $tables[' relatedTable']->getName() ?>_list', $values);71 $this->setDefault('<?php echo $tables['middleTable']->getName() ?>_list', $values); 72 72 } 73 73 … … 80 80 81 81 <?php foreach ($this->getManyToManyTables() as $tables): ?> 82 $this->save<?php echo $tables[' relatedTable']->getPhpName() ?>List($con);82 $this->save<?php echo $tables['middleTable']->getPhpName() ?>List($con); 83 83 <?php endforeach; ?> 84 84 } 85 85 86 86 <?php foreach ($this->getManyToManyTables() as $tables): ?> 87 public function save<?php echo $tables[' relatedTable']->getPhpName() ?>List($con = null)87 public function save<?php echo $tables['middleTable']->getPhpName() ?>List($con = null) 88 88 { 89 89 if (!$this->isValid()) … … 92 92 } 93 93 94 if (!isset($this->widgetSchema['<?php echo $tables[' relatedTable']->getName() ?>_list']))94 if (!isset($this->widgetSchema['<?php echo $tables['middleTable']->getName() ?>_list'])) 95 95 { 96 96 // somebody has unset this widget … … 108 108 109 109 $values = $this->getValues(); 110 if (is_array($values['<?php echo $tables[' relatedTable']->getName() ?>_list']))110 if (is_array($values['<?php echo $tables['middleTable']->getName() ?>_list'])) 111 111 { 112 foreach ($values['<?php echo $tables[' relatedTable']->getName() ?>_list'] as $value)112 foreach ($values['<?php echo $tables['middleTable']->getName() ?>_list'] as $value) 113 113 { 114 114 $obj = new <?php echo $tables['middleTable']->getPhpName() ?>(); branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/generator/sfPropelFormGenerator.class.php
r7614 r8384 364 364 foreach ($this->getManyToManyTables() as $tables) 365 365 { 366 if (($m = strlen($tables[' relatedTable']->getName().'_list')) > $max)366 if (($m = strlen($tables['middleTable']->getName().'_list')) > $max) 367 367 { 368 368 $max = $m;

