Ejemplo n.º 1
0
 /**
  * @Route("/not-interested/{id}", name="event_not_interested", requirements={"id" = "\d+"})
  * @Template()
  * @ParamConverter("Event", class="ConnectionEventBundle:Event")
  */
 public function notInterestedAction(Event $event)
 {
     if (!($user = $this->getUser())) {
         throw new AccessDeniedException("Not Logged IN");
     }
     if ($event->hasInterested($user)) {
         $user->getInterestedInEvents()->removeElement($event);
         $em = $this->getDoctrine()->getManager();
         $em->persist($user);
         $em->flush();
     }
     return new JsonResponse();
 }
 /**
  * {@inheritDoc}
  */
 public function hasInterested(\Connection\UserBundle\Entity\User $user)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'hasInterested', array($user));
     return parent::hasInterested($user);
 }