/**
  * @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;
 }
 /**
  * @param Attendee $attendee
  */
 public function confirm(Attendee $attendee)
 {
     $attendee->setStatus(Attendee::APPROVED);
     $attendee->setArrived(true);
     $this->repository->update($attendee);
 }