public function indexAction($page, $sort, $direction)
    {
        $acl = $this->get('bacon_acl.service.authorization');

        if (!$acl->authorize('module', 'INDEX')) {
            throw $this->createAccessDeniedException();
        }

        $breadcumbs = $this->container->get('bacon_breadcrumbs');

        $breadcumbs->addItem([
            'title' => 'Module',
            'route' => '',
        ]);

        $breadcumbs->addItem([
            'title' => 'List',
            'route' => '',
        ]);

        $entity = new Module();

        if ($this->get('session')->has('module_search_session')) {
            $objSerialize = $this->get('session')->get('module_search_session');
            $entity = unserialize($objSerialize);
        }

        $query = $this->getDoctrine()->getRepository('BaconAclBundle:Module')->getQueryPagination($entity, $sort, $direction);

        $paginator = $this->getPagination($query, $page, Module::PER_PAGE);
        $paginator->setUsedRoute('module_pagination');

        $form = $this->createForm(ModuleFormType::class, $entity, [
            'search' => true,
        ]);

        return [
            'pagination'  => $paginator,
            'form_search' => $form->createView(),
            'form_delete' => $this->createDeleteForm()->createView(),
        ];
    }
public function indexAction($page, $sort, $direction)
    {
        $acl = $this->get('bacon_acl.service.authorization');

        if (!$acl->authorize('module', 'INDEX')) {
            throw $this->createAccessDeniedException();
        }

        $breadcumbs = $this->container->get('bacon_breadcrumbs');

        $breadcumbs->addItem([
            'title' => 'Module',
            'route' => '',
        ]);

        $breadcumbs->addItem([
            'title' => 'List',
            'route' => '',
        ]);

        $entity = new Module();

        if ($this->get('session')->has('module_search_session')) {
            $objSerialize = $this->get('session')->get('module_search_session');
            $entity = unserialize($objSerialize);
        }

        $query = $this->getDoctrine()->getRepository('BaconAclBundle:Module')->getQueryPagination($entity, $sort, $direction);

        $paginator = $this->getPagination($query, $page, Module::PER_PAGE);
        $paginator->setUsedRoute('module_pagination');

        $form = $this->createForm(ModuleFormType::class, $entity, [
            'search' => true,
        ]);

        return [
            'pagination'  => $paginator,
            'form_search' => $form->createView(),
            'form_delete' => $this->createDeleteForm()->createView(),
        ];
    }
public function indexAction ( $ page , $ sort , $ direction ) { $ acl = $ this -> get ( 'bacon_acl.service.authorization' ) ; if ( ! $ acl -> authorize ( 'module' , 'INDEX' ) ) { throw $ this -> createAccessDeniedException ( ) ; } $ breadcumbs = $ this -> container -> get ( 'bacon_breadcrumbs' ) ; $ breadcumbs -> addItem ( [ 'title' => 'Module' , 'route' => '' , ] ) ; $ breadcumbs -> addItem ( [ 'title' => 'List' , 'route' => '' , ] ) ; $ entity = new Module ( ) ; if ( $ this -> get ( 'session' ) -> has ( 'module_search_session' ) ) { $ objSerialize = $ this -> get ( 'session' ) -> get ( 'module_search_session' ) ; $ entity = unserialize ( $ objSerialize ) ; } $ query = $ this -> getDoctrine ( ) -> getRepository ( 'BaconAclBundle:Module' ) -> getQueryPagination ( $ entity , $ sort , $ direction ) ; $ paginator = $ this -> getPagination ( $ query , $ page , Module :: PER_PAGE ) ; $ paginator -> setUsedRoute ( 'module_pagination' ) ; $ form = $ this -> createForm ( ModuleFormType :: class , $ entity , [ 'search' => true , ] ) ; return [ 'pagination' => $ paginator , 'form_search' => $ form -> createView ( ) , 'form_delete' => $ this -> createDeleteForm ( ) -> createView ( ) , ] ; }
Lists all Module entities.

@Route("/",defaults={"page"=1, "sort"="id", "direction"="asc"}, name="module")
@Route("/page/{page}/sort/{sort}/direction/{direction}/", defaults={"page"=1, "sort"="id", "direction"="asc"}, name="module_pagination")
@Method("GET")
@Security("has_role('ROLE_ADMIN')")
@Template()
Lists all Module entities .