Exemple #1
0
 /**
  * Setup Aleph driver using given configuration file
  *
  * @param string $config configuration file to use
  *
  * @throws RuntimeException
  * @return void
  */
 protected function setUpDriver($config)
 {
     $file = realpath(\VUFIND_PHPUNIT_MODULE_PATH . self::FIXTURE_DIRECTORY . 'configs/' . $config);
     if (!$file) {
         throw new RuntimeException(sprintf('Unable to get configuration for driver %s', $config));
     }
     $this->driverConfig = parse_ini_file($file, true);
     $this->driver = new Aleph(new \VuFind\Date\Converter());
     $this->mockedHttpService = $this->getMock('VuFindHttp\\HttpServiceInterface');
     $this->driver->setHttpService($this->mockedHttpService);
     $this->driver->setConfig($this->driverConfig);
     $this->driver->init();
 }
Exemple #2
0
 public function getMyTransactions($user, $history = false, $limit = 0)
 {
     $transactions = parent::getMyTransactions($user, $history, $limit);
     if ($history) {
         return $transactions;
     }
     $patronId = $user['id'];
     foreach ($transactions as &$transaction) {
         if (!$transaction['renewable']) {
             $bibId = $transaction['id'];
             $itemId = $transaction['z36_item_id'];
             try {
                 $holdingInfo = $this->getHoldingInfoForItem($patronId, $bibId, $itemId);
                 $transaction['reserved'] = $holdingInfo['order'] > 1;
             } catch (ILSException $ex) {
                 // nothing to do
             }
         }
     }
     return $transactions;
 }