Ticket #3526: DoctrineFormGeneratedTemplate_save.diff
| File DoctrineFormGeneratedTemplate_save.diff, 1.4 kB (added by thomas.s, 8 months ago) |
|---|
-
/Users/thomas/Workspace/erfahrung/symfony11/data/generator/myDoctrineForm/default/template/myDoctrineFormGeneratedTemplate.php
old new 104 104 $q = Doctrine_Query::create() 105 105 ->delete() 106 106 ->from('<?php echo $relation['refTable']->getOption('name') ?> r') 107 ->where('r.<?php echo $relation->getLocalFieldName() ?> ', $this->object->identifier())107 ->where('r.<?php echo $relation->getLocalFieldName() ?> = ?', current($this->object->identifier())) 108 108 ->execute(); 109 109 110 110 $values = $this->getValue('<?php echo $this->underscore($relation['refTable']->getOption('name')) ?>_list'); … … 113 113 foreach ($values as $value) 114 114 { 115 115 $obj = new <?php echo $relation['refTable']->getOption('name') ?>(); 116 $obj-><?php echo $relation->getLocalFieldName() ?> = $this->object->getPrimaryKey();116 $obj-><?php echo $relation->getLocalFieldName() ?> = current($this->object->identifier()); 117 117 $obj-><?php echo $relation->getForeignFieldName() ?> = $value; 118 118 $obj->save(); 119 119 }