Ejemplo n.º 1
0
 /**
  * @Secured(resource="showEvent")
  */
 public function actionShowEvent($id)
 {
     $event = null;
     try {
         if (is_numeric($id)) {
             $event = $this->eventService->getEvent($id);
         } else {
             $event = $this->eventService->getEventAlias($id);
         }
         $this->setEntity($event);
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataLoad($id, "default", $ex);
     }
     $parties = $event->getParticipations();
     $uid = $this->getUser()->getIdentity()->getId();
     $this->template->data = $event;
     $this->template->commentable = true;
     $bool = $parties->filter(function ($e) use($uid) {
         if ($e->getOwner()->getId() == $uid) {
             return true;
         }
     })->isEmpty();
     $this->template->partyExist = $bool;
     $this->template->deadline = $event->getConfirmUntil() > new DateTime() ? true : false;
 }
Ejemplo n.º 2
0
 /**
  * @Secured(resource="updateParticipation")
  */
 public function actionUpdateParticipation($id)
 {
     try {
         $e = $this->eventsService->getEvent($id);
         if ($e !== null) {
             $this->setEntity($e);
         }
         $this->template->title = $e->getTitle();
         $this->template->id = $e->getAlias();
     } catch (Exceptions\EntityNotFoundException $ex) {
         $this->handleEntityNotExists($id, "this", $ex);
     } catch (Exceptions\DataErrorException $ex) {
         $this->handleDataLoad($id, "default", $ex);
     }
 }