public function delSolImportacion(SolImportacion $solImportacion) { if (!$solImportacion) { throw $this->createNotFoundException('No se encontro entidad con ese id ' . $solImportacion->getSolImpId()); } //$this->em->remove($entidad); $this->em->flush(); $matrizMensajes = array('El proceso de eliminar termino con exito', 'SolImportacion ' . $solImportacion->getSolImpId()); return $matrizMensajes; }
/** * Devuelve el listado de solicitudes asociadas a la empresa del usuario * * @return Response */ public function verSolImportacionesJSONAction() { $user = $this->get('security.context')->getToken()->getUser(); $solImportacionDetDao = new SolImportacionDetDao($this->getDoctrine()); $registros = array(); if ($user->getEntidad() != null) { $registros = $solImportacionDetDao->getSolImportacionesDetByEntidad($user->getEntidad()->getEntId()); } $numfilas = count($registros); if ($numfilas != 0) { $solImportacion = new SolImportacion(); $i = 0; foreach ($registros as $ent) { $solImportacion->setSolImpFecha($ent['solImpFecha']); $solImportacion->setAuditDateIns($ent['auditDateIns']); if ($ent['entHabilitado'] == false || $ent['HAB'] == 0) { $registros[$i]['estNombre'] = SolImportacion::$BLOQUEADA; } $registros[$i]['solImpFechaText'] = $solImportacion->getSolImpFechaText(); $registros[$i]['auditDateInsText'] = $solImportacion->getAuditDateInsText(); $i = $i + 1; } } $datos = json_encode($registros); $pages = floor($numfilas / 10) + 1; $jsonresponse = '{ "page":"1", "total":"' . $pages . '", "records":"' . $numfilas . '", "rows":' . $datos . '}'; $response = new Response($jsonresponse); $response->headers->set('Content-Type', 'application/json'); return $response; }