Example #1
0
 public function executeAddPerson()
 {
     $this->forward404Unless($this->type = $this->getRequestParameter('type'));
     $this->forward404Unless($this->etime_id = $this->getRequestParameter('etime_id'));
     if ($this->getRequest()->getMethod() == sfRequest::POST) {
         $c = new Criteria();
         $c->setIgnoreCase(true);
         $c->add(PersonTypePeer::NAME, '%' . $this->getRequestParameter('type') . '%', Criteria::LIKE);
         $person_type = PersonTypePeer::doSelectOne($c);
         $this->forward404Unless($person_type);
         $etime_person = new EtimePeople();
         $etime_person->setEtimeId($this->getRequestParameter('etime_id'));
         $etime_person->setName($this->getRequestParameter('etime_person_name_' . $this->type));
         $etime_person->setEmail($this->getRequestParameter('etime_email_' . $this->type));
         $etime_person->setPhone($this->getRequestParameter('etime_phone_' . $this->type));
         $etime_person->setPersonTypeId($person_type->getId());
         $etime_person->save();
         return $this->redirect($this->getRequestParameter('referer', '@homepage'));
     }
     $this->getRequest()->getParameterHolder()->set('referer', $this->getRequest()->getReferer());
     return sfView::SUCCESS;
 }
Example #2
0
 public function addEtimePeople(EtimePeople $l)
 {
     $this->collEtimePeoples[] = $l;
     $l->setPersonType($this);
 }