diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Primo/Backend.php b/module/VuFindSearch/src/VuFindSearch/Backend/Primo/Backend.php index d30356373b775b95132c7747dea0d5c47ccf1893..21ea14699b16d3563e607b529d9b9af63e68fd89 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/Primo/Backend.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/Primo/Backend.php @@ -28,8 +28,6 @@ */ namespace VuFindSearch\Backend\Primo; -use VuFindSearch\Feature\RetrieveBatchInterface; - use VuFindSearch\Query\AbstractQuery; use VuFindSearch\ParamBag; @@ -49,7 +47,7 @@ use VuFindSearch\Backend\Exception\BackendException; * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org */ -class Backend extends AbstractBackend implements RetrieveBatchInterface +class Backend extends AbstractBackend { /** * Connector. @@ -152,52 +150,6 @@ class Backend extends AbstractBackend implements RetrieveBatchInterface return $collection; } - /** - * Retrieve a batch of documents. - * - * @param array $ids Array of document identifiers - * @param ParamBag $params Search backend parameters - * - * @return RecordCollectionInterface - */ - public function retrieveBatch($ids, ParamBag $params = null) - { - $onCampus = (null !== $params) ? $params->get('onCampus') : [false]; - $onCampus = $onCampus ? $onCampus[0] : false; - - // Load 100 records at a time; this is a good number to avoid memory - // problems while still covering a lot of ground. - $pageSize = 100; - - // Retrieve records a page at a time: - $results = false; - while (count($ids) > 0) { - $currentPage = array_splice($ids, 0, $pageSize, []); - - try { - $response = $this->connector->getRecords( - $currentPage, $this->connector->getInstitutionCode(), $onCampus - ); - } catch (\Exception $e) { - throw new BackendException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - $next = $this->createRecordCollection($response); - if (!$results) { - $results = $next; - } else { - foreach ($next->getRecords() as $record) { - $results->add($record); - } - } - } - $this->injectSourceIdentifier($results); - return $results; - } - /** * Set the query builder. *