Changeset 6873
- Timestamp:
- 01/01/08 08:02:15 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormGeneratedTemplate.php
r6174 r6873 55 55 <?php endif; ?> 56 56 57 <?php foreach ($this->getForeignKeyNames() as $ name):?>57 <?php foreach ($this->getForeignKeyNames() as $info): $name = $info[0] ?> 58 58 public function get<?php echo $name ?>IdentifierChoices() 59 59 { … … 65 65 if (!isset($this-><?php echo $name ?>Choices)) 66 66 { 67 $this-><?php echo $name ?>Choices = array( );67 $this-><?php echo $name ?>Choices = array(<?php !$info[1] and print "'' => ''" ?>); 68 68 foreach (<?php echo $name ?>Peer::doSelect(new Criteria(), $this->getConnection()) as $object) 69 69 { branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/generator/sfPropelFormGenerator.class.php
r6174 r6873 137 137 * This method does not returns foreign keys that are also primary keys. 138 138 * 139 * @return array An array of foreign key PHP names139 * @return array An array composed of: an array of foreign key PHP names, A Boolean to indicate whether the column is required or not 140 140 */ 141 141 public function getForeignKeyNames() … … 146 146 if (!$column->isPrimaryKey() && $column->isForeignKey()) 147 147 { 148 $names[] = $this->getForeignTable($column)->getPhpName();148 $names[] = array($this->getForeignTable($column)->getPhpName(), $column->isNotNull()); 149 149 } 150 150 } … … 152 152 foreach ($this->getManyToManyTables() as $tables) 153 153 { 154 $names[] = $tables['relatedTable']->getPhpName();154 $names[] = array($tables['relatedTable']->getPhpName(), false); 155 155 } 156 156