public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();
        //
        // IF is admin can see all the hosts, if is user only their ones...
        if (true === $this->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
            $entities = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->findAll();
        }elseif(true === $this->get('security.context')->isGranted('ROLE_RESELLER')){
            $entities = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->findByUsers($this->get('security.context')->getToken()->getUser()->getIdChildIds());
        }elseif(true === $this->get('security.context')->isGranted('ROLE_USER')){
            $entities = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->findByUser($this->get('security.context')->getToken()->getUser());
        }

        $paginator  = $this->get('knp_paginator');
        $entities = $paginator->paginate(
            $entities,
            $this->get('request')->query->get('page', 1)/*page number*/
        );

        return $this->render('ACSACSPanelWordpressBundle:WPSetup:index.html.twig', array(
            'entities' => $entities,
        ));
    }
public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();
        //
        // IF is admin can see all the hosts, if is user only their ones...
        if (true === $this->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
            $entities = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->findAll();
        }elseif(true === $this->get('security.context')->isGranted('ROLE_RESELLER')){
            $entities = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->findByUsers($this->get('security.context')->getToken()->getUser()->getIdChildIds());
        }elseif(true === $this->get('security.context')->isGranted('ROLE_USER')){
            $entities = $em->getRepository('ACSACSPanelWordpressBundle:WPSetup')->findByUser($this->get('security.context')->getToken()->getUser());
        }

        $paginator  = $this->get('knp_paginator');
        $entities = $paginator->paginate(
            $entities,
            $this->get('request')->query->get('page', 1)/*page number*/
        );

        return $this->render('ACSACSPanelWordpressBundle:WPSetup:index.html.twig', array(
            'entities' => $entities,
        ));
    }
public function indexAction ( ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; // // IF is admin can see all the hosts, if is user only their ones... if ( true === $ this -> get ( 'security.context' ) -> isGranted ( 'ROLE_SUPER_ADMIN' ) ) { $ entities = $ em -> getRepository ( 'ACSACSPanelWordpressBundle:WPSetup' ) -> findAll ( ) ; } elseif ( true === $ this -> get ( 'security.context' ) -> isGranted ( 'ROLE_RESELLER' ) ) { $ entities = $ em -> getRepository ( 'ACSACSPanelWordpressBundle:WPSetup' ) -> findByUsers ( $ this -> get ( 'security.context' ) -> getToken ( ) -> getUser ( ) -> getIdChildIds ( ) ) ; } elseif ( true === $ this -> get ( 'security.context' ) -> isGranted ( 'ROLE_USER' ) ) { $ entities = $ em -> getRepository ( 'ACSACSPanelWordpressBundle:WPSetup' ) -> findByUser ( $ this -> get ( 'security.context' ) -> getToken ( ) -> getUser ( ) ) ; } $ paginator = $ this -> get ( 'knp_paginator' ) ; $ entities = $ paginator -> paginate ( $ entities , $ this -> get ( 'request' ) -> query -> get ( 'page' , 1 ) /*page number*/ ) ; return $ this -> render ( 'ACSACSPanelWordpressBundle:WPSetup:index.html.twig' , array ( 'entities' => $ entities , ) ) ; }
Lists all WPSetup entities.
Lists all WPSetup entities .