public function addObjInst($objInstObjetivo) { $objetivoSistema = new ObjetivosInstitucionales(); $objetivoSistema->setObjInstObjetivo($objInstObjetivo); $this->em->persist($objetivoSistema); $this->em->flush(); $matrizMensajes = array('El proceso de almacenar el objetivo Institucional ha termino con exito', 'Objetivo ' . $objetivoSistema->getIdobjInst()); return $matrizMensajes; }
public function consultarObjInstJSONAction() { $ObjetivoDao = new ObjetivosInstitucionalesDao($this->getDoctrine()); $ObjetivosT = $ObjetivoDao->getObjInst(); $numfilas = count($ObjetivosT); $uni = new ObjetivosInstitucionales(); $i = 0; foreach ($ObjetivosT as $uni) { $rows[$i]['id'] = $uni->getIdobjInst(); $rows[$i]['cell'] = array($uni->getIdobjInst(), $uni->getObjInstObjetivo()); $i++; } $datos = json_encode($rows); $jsonresponse = '{ "page":"1", "total":"1", "records":"' . $numfilas . '", "rows":' . $datos . '}'; $response = new Response($jsonresponse); return $response; }