/** * Listar algunos Prestamo dado el $prestamoComputadoraId * * @param $prestamoComputadoraId * @param $performSize * @param $firstResultNumber * @param $numResults */ public function listPrestamosByPrestamoComputadoraId($prestamoComputadoraId, $performSize = false, $firstResultNumber = null, $numResults = null, $orderBy = null, $orderPriority = SQL_ASCENDING_ORDER) { $objBean = new ComputadoraBean($this->persistenceManager); $obj = new Computadora(); $obj->setId($prestamoComputadoraId); # Validamos los campos if ($firstResultNumber !== null && !EntityValidator::validatePositiveNumber($firstResultNumber)) { throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 111); } if (!EntityValidator::validateGlobalOrderPriority($orderPriority)) { throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 113); } if (!EntityValidator::validateId($prestamoComputadoraId)) { throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 115); } # Verificamos que la entidad exista if (!$objBean->getComputadora($obj)) { throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 117); } # Listamos las entidades if ($performSize) { $this->lastRequestSize = $this->prestamoBean->countGetPrestamosByPrestamoComputadora($obj); } return PrestamoDTO::loadFromEntities($this->prestamoBean->listPrestamosByPrestamoComputadora($obj, $firstResultNumber, $numResults, $orderBy, $orderPriority)); }