Skip to content
Snippets Groups Projects
Commit 06d00bc8 authored by Demian Katz's avatar Demian Katz
Browse files

Moved WorldCat query processing from Connector to Backend.

parent 580eeb0c
No related merge requests found
...@@ -127,9 +127,8 @@ class Backend implements BackendInterface ...@@ -127,9 +127,8 @@ class Backend implements BackendInterface
public function search(AbstractQuery $query, $offset, $limit, public function search(AbstractQuery $query, $offset, $limit,
ParamBag $params = null ParamBag $params = null
) { ) {
$response = $this->connector->search( $params->mergeWith($this->getQueryBuilder()->build($query));
$query, $offset, $limit, $this->getQueryBuilder(), $params $response = $this->connector->search($params, $offset, $limit);
);
$collection = $this->createRecordCollection($response); $collection = $this->createRecordCollection($response);
$this->injectSourceIdentifier($collection); $this->injectSourceIdentifier($collection);
return $collection; return $collection;
......
...@@ -130,23 +130,18 @@ class Connector extends \VuFindSearch\Backend\SRU\Connector ...@@ -130,23 +130,18 @@ class Connector extends \VuFindSearch\Backend\SRU\Connector
/** /**
* Execute a search. * Execute a search.
* *
* @param AbstractQuery $query Search query * @param ParamBag $params Parameters
* @param integer $offset Search offset * @param integer $offset Search offset
* @param integer $limit Search limit * @param integer $limit Search limit
* @param QueryBuilder $queryBuilder Query builder
* @param ParamBag $params Parameters
* *
* @return array * @return string
*/ */
public function search(AbstractQuery $query, $offset, $limit, public function search(ParamBag $params, $offset, $limit)
QueryBuilder $queryBuilder, ParamBag $params = null {
) {
$params = $params ?: new ParamBag();
$params->set('startRecord', $offset); $params->set('startRecord', $offset);
$params->set('maximumRecords', $limit); $params->set('maximumRecords', $limit);
$params->set('servicelevel', 'full'); $params->set('servicelevel', 'full');
$params->set('wskey', $this->wskey); $params->set('wskey', $this->wskey);
$params->mergeWith($queryBuilder->build($query));
// Establish a limitation on searching by OCLC Codes // Establish a limitation on searching by OCLC Codes
if (!empty($this->limitCodes)) { if (!empty($this->limitCodes)) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment