/** * @@Admin * @Route(admin/halls/create) */ public function createHall() { $venues = VenuesRepository::getInstance()->getActiveVenuesPreview(); $viewModel = new AdminCreateHallViewModel($venues); $this->renderDefaultLayout($viewModel); }
/** * @@Authorize */ public function edit(int $id) { $conference = ConferencesRepository::getInstance()->getById($id); if ($conference["ownerId"] !== $this->context->getIdentity()->getCurrentUser()->getId()) { throw new ApplicationException("Your are now allowed to edit this conference!"); } $venue = new VenueViewModel(); if ($conference["venueId"]) { $venue = new VenueViewModel($conference["venueId"], $conference["venueName"], $conference["venueDescription"], $conference["venueAddress"]); } $activeVenues = VenuesRepository::getInstance()->getActiveVenues(); $owner = new UserProfileViewModel($conference["ownerUsername"], $conference["ownerId"], $conference["ownerFullname"]); $viewModel = new EditConferenceViewModel(intval($conference["id"]), $conference["title"], $conference["description"], $conference["startTime"], $conference["endTime"], $conference["isActive"] ? TRUE : FALSE, $conference["isDismissed"] ? TRUE : FALSE, $owner, $venue, $activeVenues, []); $this->renderDefaultLayout($viewModel); }