示例#1
0
 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('id')) {
         $job = new Job();
         $job_information = new JobInformation();
     } else {
         $job = JobPeer::retrieveByPk($this->getRequestParameter('id'));
         $this->forward404Unless($job);
         $job_information = JobInformationPeer::retrieveByPk($this->getRequestParameter('job_information_id'));
         if ($job_information == null) {
             $job_information = new JobInformation();
         }
     }
     $job->setCulture($this->getUser()->getCulture());
     $job->setId($this->getRequestParameter('id'));
     /*$job->setCode($this->getRequestParameter('code'));*/
     $job->setName($this->getRequestParameter('name'));
     $job->setParent(1071);
     $job->setMenuOrder($this->getRequestParameter('menu_order'));
     $job->setDisplayMenu($this->getRequestParameter('display_menu'));
     $job->save();
     $job_information->setId($this->getRequestParameter('job_information_id'));
     $job_information->setJob($job);
     $job_information->setPublicInformationId($this->getRequestParameter('public_information_id'));
     $job_information->setJobCategoryId($this->getRequestParameter('job_category_id'));
     $job_information->save();
     return $this->redirect('job_information/list');
 }
示例#2
0
 public function addJobInformation(JobInformation $l)
 {
     $this->collJobInformations[] = $l;
     $l->setJobCategory($this);
 }
示例#3
0
 public function addJobInformation(JobInformation $l)
 {
     $this->collJobInformations[] = $l;
     $l->setPublicInformation($this);
 }