示例#1
0
 /**
  * Override sfFormDoctrine to prepare the
  * values: FORMNAME-FIELDNAME has to be transformed
  * to FORMNAME[FIELDNAME]
  */
 public function updateObject($values = null)
 {
     if (is_null($values)) {
         $values = $this->values;
         foreach ($this->embeddedForms as $name => $form) {
             foreach ($form as $field => $f) {
                 if (isset($values["{$name}-{$field}"])) {
                     // Re-rename the form field and remove
                     // the original field
                     $values[$name][$field] = $values["{$name}-{$field}"];
                     unset($values["{$name}-{$field}"]);
                 }
             }
         }
     }
     // Give the request to the original method
     parent::updateObject($values);
 }