public function consultarFuncionesOrgAction() { $request = $this->getRequest(); $idCaractOrg = $request->get('idCaractOrg'); $caractOrgAux = new CaractOrg(); $catOrgDao = new CaractOrgDao($this->getDoctrine()); $caractOrgAux = $catOrgDao->getCaractOrg($idCaractOrg); $funciones = $caractOrgAux->getFuncionesEspec(); $numfilas = count($funciones); $funcionEspec = new FuncionEspecifica(); $i = 0; foreach ($funciones as $funcionEspec) { $rows[$i]['id'] = $funcionEspec->getIdFuncEspec(); $rows[$i]['cell'] = array($funcionEspec->getIdFuncEspec(), $funcionEspec->getFuncDescripcion()); $i++; } $datos = json_encode($rows); $jsonresponse = '{ "page":"1", "total":"' . $numfilas / 10 . '", "records":"' . $numfilas . '", "rows":' . $datos . '}'; $response = new Response($jsonresponse); return $response; }