Пример #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;
 }