Exemple #1
0
 public function executeAddPerson()
 {
     $this->forward404Unless($this->type = $this->getRequestParameter('type'));
     $this->forward404Unless($this->event_id = $this->getRequestParameter('event_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);
         $event_person = new EventPeople();
         $event_person->setEventId($this->getRequestParameter('event_id'));
         $event_person->setName($this->getRequestParameter('event_person_name_' . $this->type));
         $event_person->setEmail($this->getRequestParameter('event_email_' . $this->type));
         $event_person->setPhone($this->getRequestParameter('event_phone_' . $this->type));
         $event_person->setPersonTypeId($person_type->getId());
         $event_person->save();
         $event = EventPeer::retrieveByPk($this->getRequestParameter('event_id'));
         return $this->redirect($this->getRequestParameter('referer', '@homepage'));
     }
     $this->getRequest()->getParameterHolder()->set('referer', $this->getRequest()->getReferer());
     return sfView::SUCCESS;
 }
Exemple #2
0
 public function addEventPeople(EventPeople $l)
 {
     $this->collEventPeoples[] = $l;
     $l->setPersonType($this);
 }