Gina Next Generation
 All Classes Namespaces Files Functions Variables
ShowController.php
Go to the documentation of this file.
00001 <?php
00002 
00003 namespace Admingenerated\EtraliGinangBundle\BaseProtocolController;
00004 
00005 use Admingenerator\GeneratorBundle\Controller\Doctrine\BaseController as BaseController;
00006 use Symfony\Component\HttpFoundation\RedirectResponse;use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
00007 
00008 
00009 
00010 class ShowController extends BaseController
00011 {
00012     public function indexAction($pk)
00013     {
00014         $Protocol = $this->getObject($pk);
00015 
00016         
00017 
00018         if (!$Protocol) {
00019             throw new NotFoundHttpException("The Etrali\GinangBundle\Entity\Protocol with idProtocol $pk can't be found");
00020         }
00021 
00022         return $this->render('EtraliGinangBundle:ProtocolShow:index.html.twig', array(
00023             "Protocol" => $Protocol
00024         ));
00025     }
00026 
00027 
00028     protected function getObject($pk)
00029     {
00030         return $this->getDoctrine()
00031                     ->getEntityManager()
00032                     ->getRepository('Etrali\GinangBundle\Entity\Protocol')
00033                     ->find($pk);
00034     }
00035 }
 All Classes Namespaces Files Functions Variables