Example #1
0
 public function agregarFuncEspec($funcion, $idCaractOrg)
 {
     $caractOrgAux = new CaractOrg();
     $caractOrgAux = $this->getCaractOrg($idCaractOrg);
     $funcionEspec = new FuncionEspecifica();
     $funcionEspec->setFuncDescripcion($funcion);
     $funcionEspec->setCaractOrg($caractOrgAux);
     $unidad = $caractOrgAux->getUnidadOrganizativa();
     $caractOrgAux->addFuncionesEspec($funcionEspec);
     $this->em->persist($funcionEspec);
     $this->em->persist($caractOrgAux);
     $this->em->flush();
     $matrizMensajes = array('El proceso de ingresar funcion especifica termino con exito ');
     return $matrizMensajes;
 }
 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;
 }