public function executeSave() { $emp_id = $this->getRequestParameter('employee_id'); $emp = EmployeePeer::retrieveByPK($emp_id); $this->forward404Unless($emp); $this->employee = $emp; $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'); $params = array(); foreach (explode('&', $this->getRequestParameter('subject_list_ser')) as $p) { $p = explode('=', $p); $params[rawurldecode($p[0])][] = rawurldecode($p[1]); } if (array_key_exists('subjects', $params)) { foreach ($params['subjects'] as $su_id) { $teaching_competency = new TeachingCompetency(); $teaching_competency->setSubjectId($su_id); $teaching_competency->setEmployeeId($this->getRequestParameter('employee_id')); $teaching_competency->setStatus(1); $teaching_competency->save(); } } return $this->redirect('teaching_competency/list?employee_id=' . $emp_id); }