public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('student_type_id')) { $student_type = new StudentType(); } else { $student_type = StudentTypePeer::retrieveByPk($this->getRequestParameter('student_type_id')); $this->forward404Unless($student_type); } $student = StudentPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student); $student_type->setId($this->getRequestParameter('student_type_id')); $student_type->setStatus($student->getStatus()); $student_type->setStudentId($student->getId()); $student_type->setPayerTypeId($this->getRequestParameter('payer_type_id')); $student_type->save(); return $this->redirect('student_type/list'); }