public function getSpeakerInvitationsForUser() : ServiceResponse
 {
     $userId = HttpContext::getInstance()->getIdentity()->getUserId();
     $invitations = $this->dbContext->getSpeakerInvitationsRepository()->filterBySpeakerId(" = {$userId}")->filterByStatus(" = 0")->findAll();
     $models = [];
     foreach ($invitations->getSpeakerInvitations() as $invitation) {
         $model = new SpeakerInvitationViewModel($invitation);
         $lectureId = $invitation->getLectureId();
         $lecture = $this->dbContext->getLecturesRepository()->filterById(" = {$lectureId}")->findOne();
         $model->setLectureTitle($lecture->getTitle());
         $model->setStartDate($lecture->getStartDate());
         $model->setEndDate($lecture->getEndDate());
         $conferenceId = $lecture->getConferenceId();
         $conference = $this->dbContext->getConferencesRepository()->filterById(" = {$conferenceId}")->findOne();
         $model->setConferenceTitle($conference->getTitle());
         $model->setConferenceId($conferenceId);
         $models[] = $model;
     }
     return new ServiceResponse(null, null, $models);
 }
 /**
  * @Method('GET')
  * @Route('conferences/{integer $conferenceId}/lectures/{integer $lectureId}/invite')
  * @param $conferenceId
  * @param $lectureId
  * @return View
  * @throws \Exception
  */
 public function invite(integer $conferenceId, integer $lectureId) : View
 {
     $service = new LecturesService($this->dbContext);
     $users = $this->dbContext->getUsersRepository()->orderBy('username')->findAll()->getUsers();
     $invitationModels = [];
     foreach ($users as $user) {
         $model = new SpeakerInvitation($lectureId, $user->getId(), 0);
         $viewModel = new SpeakerInvitationViewModel($model);
         $viewModel->setConferenceId($conferenceId);
         $viewModel->setSpeakerUsername($user->getUsername());
         $invitationModels[] = $viewModel;
     }
     return new View('lectures', 'invite', $invitationModels);
 }