/** * @Route("/inbox/gridsimple", name="lc_not_inbox_gridsimple") * @Template() */ public function gridSimpleAction() { $request = $this->getRequest(); $id = $request->get('confignotcli'); if (!$id) { return $this->gridFullAction(); } $sql = $this->getDoctrine()->getManager()->getRepository('PROCERGSLoginCidadaoCoreBundle:Notification\\Notification')->createQueryBuilder('n')->select('n.id, case when n.readDate is null then false else true end isread, n.title, n.shortText shorttext, n.createdAt createdat, c.id client_id, c.name client_name')->join('PROCERGSLoginCidadaoCoreBundle:Notification\\Category', 'cnc', 'WITH', 'n.category = cnc')->join('PROCERGSOAuthBundle:Client', 'c', 'WITH', 'cnc.client = c')->where('n.person = :person and cnc.id = :configNotCli')->setParameter('person', $this->getUser())->setParameter('configNotCli', $id)->orderBy('n.id', 'DESC'); if ($request->get('client')) { $sql->andWhere('c.id = :client')->setParameter('client', $request->get('client')); } $grid = new GridHelper(); $grid->setId('simpleOne' . $id); $grid->setPerPage(10); $grid->setMaxResult(10); $grid->setQueryBuilder($sql); $grid->setInfinityGrid(true); $grid->setRoute('lc_not_inbox_gridsimple'); $grid->setRouteParams(array('client', 'mode', 'notification', 'confignotcli')); return array('grid' => $grid->createView($request)); }