public function addNotiSistema($nombreNoti, $tipoMensajeNoti, $mensajeNoti) { $notificacionsistema = new NotificacionSistema(); $notificacionsistema->setNombreNoti($nombreNoti); $notificacionsistema->setTipoMensajeNoti($tipoMensajeNoti); $notificacionsistema->setMensajeNoti($mensajeNoti); $this->em->persist($notificacionsistema); $this->em->flush(); $matrizMensajes = array('El proceso de almacenar notificacion del sistema termino con exito', 'Notificacion Sistema' . $notificacionsistema->getCodNoti()); return $matrizMensajes; }
public function consultarNotificacionJSONAction() { $notificacionDao = new NotificacionSistemaDao($this->getDoctrine()); $notificacion = $notificacionDao->getNotiSistema(); $numfilas = count($notificacion); $aux = new NotificacionSistema(); $i = 0; foreach ($notificacion as $aux) { $rows[$i]['id'] = $aux->getCodNoti(); $rows[$i]['cell'] = array($aux->getCodNoti(), $aux->getNombreNoti(), $aux->getMensajeNoti(), $aux->getTipoMensajeNoti()); $i++; } $datos = json_encode($rows); $jsonresponse = '{ "page":"1", "total":"1", "records":"' . $numfilas . '", "rows":' . $datos . '}'; $response = new Response($jsonresponse); return $response; }