public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->numeroSeriePrograma) && EntityValidator::validateId($this->computadora) && EntityValidator::validateId($this->software);
 }
Ejemplo n.º 2
0
 /**
  * Eliminar un Tarea Dado el $tareaId
  * 
  * @param $tareaId
  */
 public function removeTarea($tareaId)
 {
     $tarea = new Tarea();
     $tarea->setId($tareaId);
     # Validamos los campos
     if (!EntityValidator::validateId($tareaId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 150);
     }
     # Verificamos que la entidad exista.
     if (!$this->tareaBean->getTarea($tarea)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 151);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Eliminamos la entidad
     if (!$this->tareaBean->removeTarea($tarea)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 152);
     }
 }
Ejemplo n.º 3
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->reservaClase) && EntityValidator::validateString($this->reservaHoraInicio) && EntityValidator::validateString($this->reservaHoraFin) && EntityValidator::validateId($this->reservaResponsable) && EntityValidator::validateId($this->reservaSalon);
 }
 /**
  * Eliminar un Prestamo Dado el $prestamoId
  * 
  * @param $prestamoId
  */
 public function removePrestamo($prestamoId)
 {
     $prestamo = new Prestamo();
     $prestamo->setId($prestamoId);
     # Validamos los campos
     if (!EntityValidator::validateId($prestamoId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 118);
     }
     # Verificamos que la entidad exista.
     if (!$this->prestamoBean->getPrestamo($prestamo)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 119);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Eliminamos la entidad
     if (!$this->prestamoBean->removePrestamo($prestamo)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 120);
     }
 }
Ejemplo n.º 5
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->impresionFecha) && EntityValidator::validateString($this->impresionLugar) && EntityValidator::validateId($this->impresionEstudiante);
 }
 /**
  * Eliminar un Impresion Dado el $impresionId
  * 
  * @param $impresionId
  */
 public function removeImpresion($impresionId)
 {
     $impresion = new Impresion();
     $impresion->setId($impresionId);
     # Validamos los campos
     if (!EntityValidator::validateId($impresionId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 84);
     }
     # Verificamos que la entidad exista.
     if (!$this->impresionBean->getImpresion($impresion)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 85);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Eliminamos la entidad
     if (!$this->impresionBean->removeImpresion($impresion)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 86);
     }
 }
Ejemplo n.º 7
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->monitorSalonEntrada) && EntityValidator::validateString($this->monitorSalonSalida) && EntityValidator::validateId($this->monitor) && EntityValidator::validateId($this->salon);
 }
Ejemplo n.º 8
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->responsableFacultad) && EntityValidator::validateString($this->responsableAsignatura) && EntityValidator::validateId($this->responsablePersona);
 }
 /**
  * Eliminar un ComputadoraSoftware Dado el $computadoraSoftwareId
  * 
  * @param $computadoraSoftwareId
  */
 public function removeComputadoraSoftware($computadoraSoftwareId)
 {
     $computadoraSoftware = new ComputadoraSoftware();
     $computadoraSoftware->setId($computadoraSoftwareId);
     # Validamos los campos
     if (!EntityValidator::validateId($computadoraSoftwareId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 112);
     }
     # Verificamos que la entidad exista.
     if (!$this->computadoraSoftwareBean->getComputadoraSoftware($computadoraSoftware)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 113);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Eliminamos la entidad
     if (!$this->computadoraSoftwareBean->removeComputadoraSoftware($computadoraSoftware)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 114);
     }
 }
Ejemplo n.º 10
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->estudianteCodigo) && EntityValidator::validateString($this->estudianteFacultad) && EntityValidator::validateString($this->estudianteCarrerra) && EntityValidator::validateId($this->estudiantePersona);
 }
 /**
  * Eliminar un Software Dado el $softwareId
  * 
  * @param $softwareId
  */
 public function removeSoftware($softwareId)
 {
     $computadoraSoftwareBean = new ComputadoraSoftwareBean($this->persistenceManager);
     $software = new Software();
     $software->setId($softwareId);
     # Validamos los campos
     if (!EntityValidator::validateId($softwareId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 249);
     }
     # Verificamos que la entidad exista.
     if (!$this->softwareBean->getSoftware($software)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 250);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Verificamos que la entidad no esté siendo utilziada en ComputadoraSoftware->software
     $computadoraSoftwares = $computadoraSoftwareBean->getComputadoraSoftwaresBySoftware($software);
     if (count($computadoraSoftwares) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 248);
     }
     # Eliminamos la entidad
     if (!$this->softwareBean->removeSoftware($software)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 251);
     }
 }
Ejemplo n.º 12
0
 /**
  * Eliminar un Salon Dado el $salonId
  * 
  * @param $salonId
  */
 public function removeSalon($salonId)
 {
     $objetoEnInventarioBean = new ObjetoEnInventarioBean($this->persistenceManager);
     $objetoPerdidoBean = new ObjetoPerdidoBean($this->persistenceManager);
     $monitorSalonBean = new MonitorSalonBean($this->persistenceManager);
     $reservaBean = new ReservaBean($this->persistenceManager);
     $salon = new Salon();
     $salon->setId($salonId);
     # Validamos los campos
     if (!EntityValidator::validateId($salonId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 54);
     }
     # Verificamos que la entidad exista.
     if (!$this->salonBean->getSalon($salon)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 55);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Verificamos que la entidad no esté siendo utilziada en ObjetoEnInventario->inventarioSalon
     $objetoEnInventarios = $objetoEnInventarioBean->getObjetoEnInventariosByInventarioSalon($salon);
     if (count($objetoEnInventarios) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 50);
     }
     # Verificamos que la entidad no esté siendo utilziada en ObjetoPerdido->objetoPerdidoSalon
     $objetoPerdidos = $objetoPerdidoBean->getObjetoPerdidosByObjetoPerdidoSalon($salon);
     if (count($objetoPerdidos) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 51);
     }
     # Verificamos que la entidad no esté siendo utilziada en MonitorSalon->salon
     $monitorSalons = $monitorSalonBean->getMonitorSalonsBySalon($salon);
     if (count($monitorSalons) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 52);
     }
     # Verificamos que la entidad no esté siendo utilziada en Reserva->reservaSalon
     $reservas = $reservaBean->getReservasByReservaSalon($salon);
     if (count($reservas) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 53);
     }
     # Eliminamos la entidad
     if (!$this->salonBean->removeSalon($salon)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 56);
     }
 }
Ejemplo n.º 13
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->tareaDescripcion) && EntityValidator::validateString($this->tareaComentarios) && EntityValidator::validateString($this->tareaFechaInicio) && EntityValidator::validateString($this->tareaFechaFin) && EntityValidator::validateId($this->tareaMonitor);
 }
 /**
  * Eliminar un Persona Dado el $personaId
  * 
  * @param $personaId
  */
 public function removePersona($personaId)
 {
     $responsableBean = new ResponsableBean($this->persistenceManager);
     $estudianteBean = new EstudianteBean($this->persistenceManager);
     $persona = new Persona();
     $persona->setId($personaId);
     # Validamos los campos
     if (!EntityValidator::validateId($personaId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 136);
     }
     # Verificamos que la entidad exista.
     if (!$this->personaBean->getPersona($persona)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 137);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Verificamos que la entidad no esté siendo utilziada en Responsable->responsablePersona
     $responsables = $responsableBean->getResponsablesByResponsablePersona($persona);
     if (count($responsables) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 134);
     }
     # Verificamos que la entidad no esté siendo utilziada en Estudiante->estudiantePersona
     $estudiantes = $estudianteBean->getEstudiantesByEstudiantePersona($persona);
     if (count($estudiantes) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 135);
     }
     # Eliminamos la entidad
     if (!$this->personaBean->removePersona($persona)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 138);
     }
 }
Ejemplo n.º 15
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->monitorTipo) && EntityValidator::validateString($this->monitorHorario) && EntityValidator::validateId($this->monitorEstudiante);
 }
 /**
  * Eliminar un Computadora Dado el $computadoraId
  *
  * @param $computadoraId
  */
 public function removeComputadoraCustom($computadoraId)
 {
     $computadoraSoftwareBean = new ComputadoraSoftwareBean($this->persistenceManager);
     $prestamoBean = new PrestamoBean($this->persistenceManager);
     $objetoEnInventarioBean = new ObjetoEnInventarioBean($this->persistenceManager);
     $computadora = new Computadora();
     $computadora->setId($computadoraId);
     # Validamos los campos
     if (!EntityValidator::validateId($computadoraId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 271);
     }
     # Verificamos que la entidad exista.
     if (!$this->computadoraBean->getComputadora($computadora)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 272);
     }
     # Eliminamos la entidad
     if (!$this->computadoraBean->removeComputadora($computadora)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 273);
     }
 }
Ejemplo n.º 17
0
 public function isEntityValid()
 {
     $otherValidations = true;
     if ($this->objetoPerdidoEstudiante !== null) {
         $otherValidations = $otherValidations && EntityValidator::validateId($this->objetoPerdidoEstudiante);
     }
     return $otherValidations && EntityValidator::validateString($this->objetoPerdidoElemento) && EntityValidator::validateString($this->objetoPerdidoFecha) && EntityValidator::validateString($this->objetoPerdidoCorreo) && EntityValidator::validateString($this->objetoPerdidoFechaDevolucion) && EntityValidator::validateId($this->objetoPerdidoSalon);
 }
 /**
  * Eliminar un ObjetoEnInventario Dado el $objetoEnInventarioId
  *
  * @param $objetoEnInventarioId
  */
 public function removeObjetoEnInventario($objetoEnInventarioId)
 {
     $objetoEnInventario = new ObjetoEnInventario();
     $objetoEnInventario->setId($objetoEnInventarioId);
     # Validamos los campos
     if (!EntityValidator::validateId($objetoEnInventarioId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 112);
     }
     # Verificamos que la entidad exista.
     if (!$this->objetoEnInventarioBean->getObjetoEnInventario($objetoEnInventario)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 113);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Eliminamos la entidad
     if (!$this->objetoEnInventarioBean->removeObjetoEnInventario($objetoEnInventario)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 114);
     }
 }
 /**
  * Eliminar un SoftwareComputadoraBackup Dado el $softwareComputadoraBackupId
  * 
  * @param $softwareComputadoraBackupId
  */
 public function removeSoftwareComputadoraBackup($softwareComputadoraBackupId)
 {
     $softwareComputadoraBackup = new SoftwareComputadoraBackup();
     $softwareComputadoraBackup->setId($softwareComputadoraBackupId);
     # Validamos los campos
     if (!EntityValidator::validateId($softwareComputadoraBackupId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 188);
     }
     # Verificamos que la entidad exista.
     if (!$this->softwareComputadoraBackupBean->getSoftwareComputadoraBackup($softwareComputadoraBackup)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 189);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Eliminamos la entidad
     if (!$this->softwareComputadoraBackupBean->removeSoftwareComputadoraBackup($softwareComputadoraBackup)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 190);
     }
 }
 /**
  * Eliminar un Estudiante Dado el $estudianteId
  *
  * @param $estudianteId
  */
 public function removeEstudiante($estudianteId)
 {
     $objetoPerdidoBean = new ObjetoPerdidoBean($this->persistenceManager);
     $prestamoBean = new PrestamoBean($this->persistenceManager);
     $impresionBean = new ImpresionBean($this->persistenceManager);
     $monitorBean = new MonitorBean($this->persistenceManager);
     $estudiante = new Estudiante();
     $estudiante->setId($estudianteId);
     # Validamos los campos
     if (!EntityValidator::validateId($estudianteId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 148);
     }
     # Verificamos que la entidad exista.
     if (!$this->estudianteBean->getEstudiante($estudiante)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 149);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Verificamos que la entidad no esté siendo utilziada en ObjetoPerdido->objetoPerdidoEstudiante
     $objetoPerdidos = $objetoPerdidoBean->getObjetoPerdidosByObjetoPerdidoEstudiante($estudiante);
     if (count($objetoPerdidos) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 144);
     }
     # Verificamos que la entidad no esté siendo utilziada en Prestamo->prestamoEstudiante
     $prestamos = $prestamoBean->getPrestamosByPrestamoEstudiante($estudiante);
     if (count($prestamos) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 145);
     }
     # Verificamos que la entidad no esté siendo utilziada en Impresion->impresionEstudiante
     $impresions = $impresionBean->getImpresionsByImpresionEstudiante($estudiante);
     if (count($impresions) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 146);
     }
     # Verificamos que la entidad no esté siendo utilziada en Monitor->monitorEstudiante
     $monitors = $monitorBean->getMonitorsByMonitorEstudiante($estudiante);
     if (count($monitors) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 147);
     }
     # Eliminamos la entidad
     if (!$this->estudianteBean->removeEstudiante($estudiante)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 150);
     }
 }
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->inventarioElemento) && EntityValidator::validateString($this->inventarioNumeroSerie) && EntityValidator::validateId($this->inventarioSalon) && EntityValidator::validateId($this->computadora);
 }
Ejemplo n.º 22
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->prestamoEntrada) && EntityValidator::validateString($this->prestamoSalida) && EntityValidator::validateId($this->prestamoEstudiante) && EntityValidator::validateId($this->prestamoComputadora);
 }
 /**
  * Eliminar un Responsable Dado el $responsableId
  * 
  * @param $responsableId
  */
 public function removeResponsable($responsableId)
 {
     $reservaBean = new ReservaBean($this->persistenceManager);
     $responsable = new Responsable();
     $responsable->setId($responsableId);
     # Validamos los campos
     if (!EntityValidator::validateId($responsableId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 103);
     }
     # Verificamos que la entidad exista.
     if (!$this->responsableBean->getResponsable($responsable)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 104);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Verificamos que la entidad no esté siendo utilziada en Reserva->reservaResponsable
     $reservas = $reservaBean->getReservasByReservaResponsable($responsable);
     if (count($reservas) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 102);
     }
     # Eliminamos la entidad
     if (!$this->responsableBean->removeResponsable($responsable)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 105);
     }
 }
 /**
  * Eliminar un Monitor Dado el $monitorId
  * 
  * @param $monitorId
  */
 public function removeMonitor($monitorId)
 {
     $tareaBean = new TareaBean($this->persistenceManager);
     $monitorSalonBean = new MonitorSalonBean($this->persistenceManager);
     $monitor = new Monitor();
     $monitor->setId($monitorId);
     # Validamos los campos
     if (!EntityValidator::validateId($monitorId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 104);
     }
     # Verificamos que la entidad exista.
     if (!$this->monitorBean->getMonitor($monitor)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 105);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Verificamos que la entidad no esté siendo utilziada en Tarea->tareaMonitor
     $tareas = $tareaBean->getTareasByTareaMonitor($monitor);
     if (count($tareas) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 102);
     }
     # Verificamos que la entidad no esté siendo utilziada en MonitorSalon->monitor
     $monitorSalons = $monitorSalonBean->getMonitorSalonsByMonitor($monitor);
     if (count($monitorSalons) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 103);
     }
     # Eliminamos la entidad
     if (!$this->monitorBean->removeMonitor($monitor)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 106);
     }
 }