protected function barcodeToID($bar) { if (!$this->alephWebService->isXServerEnabled()) { return null; } foreach ($this->bib as $base) { try { $xml = $this->alephWebService->doXRequest("find", array("base" => $base, "request" => "BAR={$bar}"), false); $docs = (int) $xml->{"no_records"}; if ($docs == 1) { $set = (string) $xml->{"set_number"}; $result = $this->alephWebService->doXRequest("present", array("set_number" => $set, "set_entry" => "1"), false); $id = $result->xpath('//doc_number/text()'); if (count($this->bib) == 1) { return (string) $id[0]; } else { return $base . "-" . $id[0]; } } } catch (\Exception $ex) { // not found } } return null; }
/** * Get Patron Profile * * This is responsible for retrieving the profile for a specific patron. * * @param array $user The patron array * * @throws ILSException * @return array Array of the patron's profile data on success. */ public function getMyProfile($user) { if ($this->alephWebService->isXServerEnabled()) { return $this->getMyProfileX($user); } else { return $this->getMyProfileDLF($user); } }