/**
  * @param Attendee $attendee
  */
 public function registerPayment(Attendee $attendee)
 {
     $attendee->setStatus(Attendee::WAITING_PAYMENT);
     $this->registrationService->createPayment($attendee, '');
     $this->paymentService->approvePayment($attendee->getLastPayment(), false);
     $this->confirm($attendee);
 }
Esempio n. 2
0
 /**
  * @param Event $event
  * @param User $user
  * @param boolean $isStudent
  * @param string $registrationType
  * @return Attendee
  */
 public function create(Event $event, User $user, $isStudent, $registrationType)
 {
     $attendee = new Attendee();
     $attendee->setEvent($event);
     $attendee->setUser($user);
     $attendee->setStatus(Attendee::WAITING_PAYMENT);
     $attendee->setArrived(false);
     $attendee->setStudentRegistration($isStudent);
     $attendee->setRegistrationType($registrationType);
     $attendee->setCreationTime(new DateTime());
     if ($this->talkService->userHasAnyApprovedTalk($user, $event)) {
         $attendee->setStatus(Attendee::PAYMENT_NOT_NECESSARY);
         $attendee->setRegistrationType(Attendee::WORKSHOPS_AND_TALKS);
     }
     return $attendee;
 }