/** * Public method for getting title level holds * * @param string $id A Bib ID * * @return string|bool URL to place hold, or false if hold option unavailable * * @todo Indicate login failure or ILS connection failure somehow? */ public function getHold($id) { // Get Holdings Data if ($this->catalog) { $mode = $this->catalog->getTitleHoldsMode(); if ($mode == 'disabled') { return false; } else { if ($mode == 'driver') { try { $patron = $this->ilsAuth->storedCatalogLogin(); } catch (ILSException $e) { return false; } if (!$patron) { return false; } return $this->driverHold($id, $patron); } else { try { $patron = $this->ilsAuth->storedCatalogLogin(); } catch (ILSException $e) { $patron = false; } $mode = $this->checkOverrideMode($id, $mode); return $this->generateHold($id, $mode, $patron); } } } return false; }
/** * Public method for getting item holdings from the catalog and selecting which * holding method to call * * @param string $id A Bib ID * @param array $ids A list of Source Records (if catalog is for a consortium) * * @return array A sorted results set */ public function getHoldings($id, $ids = null) { $holdings = []; // Get Holdings Data if ($this->catalog) { // Retrieve stored patron credentials; it is the responsibility of the // controller and view to inform the user that these credentials are // needed for hold data. $patron = $this->ilsAuth->storedCatalogLogin(); // Does this ILS Driver handle consortial holdings? $config = $this->catalog->checkFunction('Holds', compact('id', 'patron')); if (isset($config['consortium']) && $config['consortium'] == true) { $result = $this->catalog->getConsortialHoldings($id, $patron ? $patron : null, $ids); } else { $result = $this->catalog->getHolding($id, $patron ? $patron : null); } $mode = $this->catalog->getHoldsMode(); if ($mode == "disabled") { $holdings = $this->standardHoldings($result); } else { if ($mode == "driver") { $holdings = $this->driverHoldings($result, $config); } else { $holdings = $this->generateHoldings($result, $mode, $config); } } $holdings = $this->processStorageRetrievalRequests($holdings, $id, $patron); $holdings = $this->processILLRequests($holdings, $id, $patron); } return $this->formatHoldings($holdings); }
/** * Get patron (catalog login data) * * @return Array */ protected function getPatron() { return $this->ilsAuth->storedCatalogLogin(); }