コード例 #1
0
 /**
  * @Route("/{id}", name="view_profile", requirements={"id" = "\d+"})
  * @Template()
  * @ParamConverter("Profile", class="ConnectionUserBundle:Profile")
  */
 public function viewAction(Profile $profile)
 {
     $user = $profile->getUser();
     if ($user->getHide() || $user->getAdmin()) {
         throw new NotFoundHttpException("Profile Not Found");
     }
     if ($this->getUser() == $user) {
         return new RedirectResponse($this->get('router')->generate('edit_user_profile'));
     }
     $userPhotos = $this->getDoctrine()->getRepository('ConnectionUserBundle:Profile\\Image')->getGroupedByGalleryImages($user->getId());
     return array('user' => $user, 'userPhotos' => $userPhotos, 'events' => $user->getEvents());
 }
 /**
  * {@inheritDoc}
  */
 public function getUser()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUser', array());
     return parent::getUser();
 }