/**
  * 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);
     }
 }
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->inventarioElemento) && EntityValidator::validateString($this->inventarioNumeroSerie) && EntityValidator::validateId($this->inventarioSalon) && EntityValidator::validateId($this->computadora);
 }
 /**
  * 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);
     }
 }
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->softwareNumeroSerie) && EntityValidator::validateString($this->softwareNombre) && EntityValidator::validateString($this->softwareVersion) && EntityValidator::validateNumber($this->softwareEquiposPermitidos);
 }
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateNumber($this->prestamoId) && EntityValidator::validateString($this->prestamoEntradaBackup) && EntityValidator::validateString($this->prestamoSalidaBackup) && EntityValidator::validateNumber($this->prestamoEstudianteBackup) && EntityValidator::validateNumber($this->prestamoComputadoraBackup) && EntityValidator::validateString($this->prestamoBackupFechaBackup);
 }
Beispiel #6
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->monitorTipo) && EntityValidator::validateString($this->monitorHorario) && EntityValidator::validateId($this->monitorEstudiante);
 }
 /**
  * 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);
     }
 }
                     } else {
                         $entity->set($key, NULL);
                         // this is required since this field could have been over written by init($_POST)
                     }
                 }
             } else {
                 // New Entity
                 $entity->set($key, NULL);
                 $entity->length($key, 0);
             }
         }
     }
     // END: if($field->getDataType() == "binary")
 }
 // Re-Validate Entity (after processing uploads)
 $errs = EntityValidator::validate($entity);
 if (count($errs) == 0) {
     if ($entityId) {
         /*
         // Update an existing Entity
         */
         try {
             // Make sure the user has permission to perform this action
             if (BPConfig::$guardian_enable !== true || Guardian::authorize(Session::user(BPConfig::$guardian_identity_session_key), "UPDATE", $entityBP->getKey(), $entityId)) {
                 $dao->update($entity);
                 $responseNode->appendChild($dom->createElement("status", "success"));
                 $responseNode->appendChild($dom->createElement("message", "Updated {$entitySignature} ({$entityId})"));
             } else {
                 Log::warning("* Guardian denied access to update " . $entityBP->getKey() . " with ID {$entityId}");
                 $responseNode->appendChild($dom->createElement("status", "error"));
                 $responseNode->appendChild($dom->createElement("message", "Access Denied"));
 /**
  * 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);
     }
 }
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->computadoraNombre) && EntityValidator::validateString($this->computadoraRam) && EntityValidator::validateString($this->computadoraProcesador) && EntityValidator::validateString($this->computadoraDiscoDuro);
 }
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->responsableFacultad) && EntityValidator::validateString($this->responsableAsignatura) && EntityValidator::validateId($this->responsablePersona);
 }
 /**
  * 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);
     }
 }
Beispiel #13
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->usuarioLogin) && EntityValidator::validateString($this->usuarioClave) && EntityValidator::validateString($this->usuarioTipo);
 }
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->estudianteCodigo) && EntityValidator::validateString($this->estudianteFacultad) && EntityValidator::validateString($this->estudianteCarrerra) && EntityValidator::validateId($this->estudiantePersona);
 }
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->numeroSeriePrograma) && EntityValidator::validateId($this->computadora) && EntityValidator::validateId($this->software);
 }
 /**
  * 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);
     }
 }
 public function update(Entity $entity)
 {
     $tag = "EntityDAO: update()";
     Log::notice("{$tag}");
     $entity_id = $entity->getId();
     if (empty($entity_id)) {
         Log::error("{$tag}: Entity id is not set");
         throw new Exception("Entity id is not set");
     }
     $errs = EntityValidator::validate($entity);
     if (count($errs) > 0) {
         Log::error("{$tag}: Entity has validation errors");
         throw new Exception("Entity has validation errors");
     }
     $blueprint = $this->blueprint;
     $timezone_offset = $this->timezone_offset_modify;
     $query = "UPDATE " . $this->tableName() . " SET ";
     foreach ($blueprint->fields() as $field) {
         $key = $field->getKey();
         $value = $entity->get($key);
         $encType = $field->getEncType();
         if (!empty($value) || $value == "0") {
             // Handle encoded fields
             if (!empty($encType) && $encType != "plain") {
                 // Determine if encoded field value should be replaced
                 // Load the existing entity to compare to the updated entity
                 try {
                     $existingEntity = $this->load($entity_id);
                     $currentEncodedValue = $existingEntity->get("{$key}");
                     if ($currentEncodedValue == $value) {
                         // Do not update this already encoded value
                         $value = $value;
                         // does nothing
                         Log::debug("{$tag}: Leaving encrypted value for {$key} alone");
                     } else {
                         $value = hash($encType, $value);
                         Log::debug("{$tag}: Encrypted value for {$key}: {$value}");
                     }
                 } catch (Exception $e) {
                     Log::error("{$tag}: Exception: " . $e->getMessage());
                     throw $e;
                 }
             }
             switch ($field->getDataType()) {
                 case "int":
                     $query .= "{$key}={$value}";
                     break;
                 case "decimal":
                 case "date":
                     $query .= "{$key}='{$value}'";
                     break;
                 case "datetime":
                 case "time":
                     $query .= "{$key}=CONVERT_TZ('{$value}', '{$timezone_offset}', '" . BPTimezone::UTC . "')";
                     break;
                 case "enum":
                     $query .= "{$key}='{$value}'";
                     break;
                 case "string":
                 case "text":
                 case "binary":
                     $value = DatabaseSanitizer::sanitize($value);
                     $query .= "{$key}='{$value}'";
                     break;
             }
         } else {
             $query .= "{$key}=NULL";
         }
         $query .= ", ";
     }
     // END: foreach($blueprint->fields() as $field)
     $query = substr($query, 0, strlen($query) - 2);
     // remove trailing comma and space (", ")
     $query .= " WHERE id=" . $entity_id;
     $sql = new DatabaseUpdate($query, "update");
     try {
         $sql->doUpdate();
         return $entity_id;
     } catch (Exception $e) {
         Log::error("{$tag}: [" . $sql->err_code . "] " . $sql->err_message);
         throw $e;
     }
 }
 /**
  * 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);
     }
 }
 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);
 }
Beispiel #20
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->salonNombre);
 }
 /**
  * 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->monitorSalonEntrada) && EntityValidator::validateString($this->monitorSalonSalida) && EntityValidator::validateId($this->monitor) && EntityValidator::validateId($this->salon);
 }
Beispiel #24
0
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateString($this->prestamoEntrada) && EntityValidator::validateString($this->prestamoSalida) && EntityValidator::validateId($this->prestamoEstudiante) && EntityValidator::validateId($this->prestamoComputadora);
 }
 public static function validate(Entity $entity)
 {
     $tag = "EntityValidator::validate()";
     Log::notice("{$tag}");
     $blueprint = $entity->blueprint();
     $errs = array();
     foreach ($blueprint->fields() as $field) {
         $key = $field->getKey();
         if ($err = EntityValidator::validateField($entity, $key)) {
             $errs["{$key}"] = $err;
         }
     }
     // log errors
     foreach ($errs as $key => $err) {
         Log::warning("{$tag}: [{$key}] {$err}");
     }
     return $errs;
 }
 /**
  * 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);
     }
 }
 public function isEntityValid()
 {
     $otherValidations = true;
     return $otherValidations && EntityValidator::validateNumber($this->idSoftwareComputadora) && EntityValidator::validateString($this->numeroSerieProgramaBackup) && EntityValidator::validateNumber($this->computadoraBackup) && EntityValidator::validateNumber($this->softwareBackup) && EntityValidator::validateString($this->fechaBackupSC);
 }
 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 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);
     }
 }
Beispiel #30
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);
 }