diff --git a/module/VuFind/src/VuFind/Search/Base/Results.php b/module/VuFind/src/VuFind/Search/Base/Results.php index 0145551906ce810fe01500f6ade8289b70a6024d..c86c063f93c802cf9c326ceb4e5930b444e1ee88 100644 --- a/module/VuFind/src/VuFind/Search/Base/Results.php +++ b/module/VuFind/src/VuFind/Search/Base/Results.php @@ -59,6 +59,13 @@ abstract class Results */ protected $resultTotal = null; + /** + * Search backend identifier. + * + * @var string + */ + protected $backendId; + /** * Override (only for use in very rare cases) * @@ -403,6 +410,16 @@ abstract class Results return $this->errors; } + /** + * Basic 'getter' of search backend identifier. + * + * @return string + */ + public function getBackendId() + { + return $this->backendId; + } + /** * Basic 'getter' for ID of saved search. * diff --git a/module/VuFind/src/VuFind/Search/BrowZine/Results.php b/module/VuFind/src/VuFind/Search/BrowZine/Results.php index 4a77ad77bf555cb650d7a6bc1c755b42f05b5d9e..8b68a1ee035732219e406e19b76d93b1671b56a8 100644 --- a/module/VuFind/src/VuFind/Search/BrowZine/Results.php +++ b/module/VuFind/src/VuFind/Search/BrowZine/Results.php @@ -42,19 +42,11 @@ use VuFindSearch\Service as SearchService; class Results extends \VuFind\Search\Base\Results { /** - * Constructor + * Search backend identifier. * - * @param \VuFind\Search\Base\Params $params Object representing user - * search parameters. - * @param SearchService $searchService Search service - * @param Loader $recordLoader Record loader + * @var string */ - public function __construct(\VuFind\Search\Base\Params $params, - SearchService $searchService, Loader $recordLoader - ) { - parent::__construct($params, $searchService, $recordLoader); - $this->backendId = 'BrowZine'; - } + protected $backendId = 'BrowZine'; /** * Returns the stored list of facets for the last search @@ -83,7 +75,7 @@ class Results extends \VuFind\Search\Base\Results $limit = $this->getParams()->getLimit(); $offset = $this->getStartRecord() - 1; $collection = $this->getSearchService()->search( - 'BrowZine', $query, $offset, $limit + $this->backendId, $query, $offset, $limit ); $this->resultTotal = $collection->getTotal(); diff --git a/module/VuFind/src/VuFind/Search/EDS/Results.php b/module/VuFind/src/VuFind/Search/EDS/Results.php index 5e1cc555b68ce2ea99f603972aef65db2a46f091..dde62f39b435e1177fe6b6074a3bc330f0fef864 100644 --- a/module/VuFind/src/VuFind/Search/EDS/Results.php +++ b/module/VuFind/src/VuFind/Search/EDS/Results.php @@ -38,6 +38,13 @@ namespace VuFind\Search\EDS; */ class Results extends \VuFind\Search\Base\Results { + /** + * Search backend identifier. + * + * @var string + */ + protected $backendId = 'EDS'; + /** * Support method for performAndProcessSearch -- perform a search based on the * parameters passed to the object. @@ -51,7 +58,7 @@ class Results extends \VuFind\Search\Base\Results $offset = $this->getStartRecord() - 1; $params = $this->getParams()->getBackendParameters(); $collection = $this->getSearchService()->search( - 'EDS', $query, $offset, $limit, $params + $this->backendId, $query, $offset, $limit, $params ); if (null != $collection) { $this->responseFacets = $collection->getFacets(); diff --git a/module/VuFind/src/VuFind/Search/EIT/Results.php b/module/VuFind/src/VuFind/Search/EIT/Results.php index de7ee5a08a560c1b81325770720bfdfacbbf1cf1..9ccc136b9d5e701d65d04027a28b852c226a9830 100644 --- a/module/VuFind/src/VuFind/Search/EIT/Results.php +++ b/module/VuFind/src/VuFind/Search/EIT/Results.php @@ -42,6 +42,13 @@ namespace VuFind\Search\EIT; */ class Results extends \VuFind\Search\Base\Results { + /** + * Search backend identifier. + * + * @var string + */ + protected $backendId = 'EIT'; + /** * Support method for performAndProcessSearch -- perform a search based on the * parameters passed to the object. @@ -55,7 +62,7 @@ class Results extends \VuFind\Search\Base\Results $offset = $this->getStartRecord() - 1; $params = $this->getParams()->getBackendParameters(); $collection = $this->getSearchService() - ->search('EIT', $query, $offset, $limit, $params); + ->search($this->backendId, $query, $offset, $limit, $params); $this->resultTotal = $collection->getTotal(); $this->results = $collection->getRecords(); diff --git a/module/VuFind/src/VuFind/Search/LibGuides/Results.php b/module/VuFind/src/VuFind/Search/LibGuides/Results.php index 73f8346ab4fac5137d6f1f0b9b4c865027608a7b..013ac46ae528b56c43be654b48744ec0e524e88f 100644 --- a/module/VuFind/src/VuFind/Search/LibGuides/Results.php +++ b/module/VuFind/src/VuFind/Search/LibGuides/Results.php @@ -38,6 +38,13 @@ namespace VuFind\Search\LibGuides; */ class Results extends \VuFind\Search\Base\Results { + /** + * Search backend identifier. + * + * @var string + */ + protected $backendId = 'LibGuides'; + /** * Support method for performAndProcessSearch -- perform a search based on the * parameters passed to the object. @@ -50,7 +57,7 @@ class Results extends \VuFind\Search\Base\Results $limit = $this->getParams()->getLimit(); $offset = $this->getStartRecord() - 1; $collection = $this->getSearchService()->search( - 'LibGuides', $query, $offset, $limit + $this->backendId, $query, $offset, $limit ); $this->resultTotal = $collection->getTotal(); diff --git a/module/VuFind/src/VuFind/Search/Pazpar2/Results.php b/module/VuFind/src/VuFind/Search/Pazpar2/Results.php index eed844b0e3eb478197b86758af5dc6689fbd2544..3bfcf1aeafcb60f6a2712d0445279181a7635dd7 100644 --- a/module/VuFind/src/VuFind/Search/Pazpar2/Results.php +++ b/module/VuFind/src/VuFind/Search/Pazpar2/Results.php @@ -38,6 +38,13 @@ namespace VuFind\Search\Pazpar2; */ class Results extends \VuFind\Search\Base\Results { + /** + * Search backend identifier. + * + * @var string + */ + protected $backendId = 'Pazpar2'; + /** * Support method for performAndProcessSearch -- perform a search based on the * parameters passed to the object. @@ -51,7 +58,7 @@ class Results extends \VuFind\Search\Base\Results $offset = $this->getStartRecord() - 1; $params = $this->getParams()->getBackendParameters(); $collection = $this->getSearchService() - ->search('Pazpar2', $query, $offset, $limit, $params); + ->search($this->backendId, $query, $offset, $limit, $params); $this->resultTotal = $collection->getTotal(); $this->results = $collection->getRecords(); diff --git a/module/VuFind/src/VuFind/Search/Primo/Results.php b/module/VuFind/src/VuFind/Search/Primo/Results.php index f2fac9cc3863e16a774b182d3e594c723f332319..6db5e9de938962fbc6f25034bc42111db50c4ca9 100644 --- a/module/VuFind/src/VuFind/Search/Primo/Results.php +++ b/module/VuFind/src/VuFind/Search/Primo/Results.php @@ -38,6 +38,13 @@ namespace VuFind\Search\Primo; */ class Results extends \VuFind\Search\Base\Results { + /** + * Search backend identifier. + * + * @var string + */ + protected $backendId = 'Primo'; + /** * Support method for performAndProcessSearch -- perform a search based on the * parameters passed to the object. @@ -51,7 +58,7 @@ class Results extends \VuFind\Search\Base\Results $offset = $this->getStartRecord() - 1; $params = $this->getParams()->getBackendParameters(); $collection = $this->getSearchService()->search( - 'Primo', $query, $offset, $limit, $params + $this->backendId, $query, $offset, $limit, $params ); $this->responseFacets = $collection->getFacets(); diff --git a/module/VuFind/src/VuFind/Search/Solr/Results.php b/module/VuFind/src/VuFind/Search/Solr/Results.php index 5d725772acd6a9089a91fcd85363a948cdc9966c..41fcb383ef498924d991ebb13baddb7b68ea6741 100644 --- a/module/VuFind/src/VuFind/Search/Solr/Results.php +++ b/module/VuFind/src/VuFind/Search/Solr/Results.php @@ -51,7 +51,7 @@ class Results extends \VuFind\Search\Base\Results protected $responseFacets = null; /** - * Search backend identifiers. + * Search backend identifier. * * @var string */ diff --git a/module/VuFind/src/VuFind/Search/SolrAuth/Results.php b/module/VuFind/src/VuFind/Search/SolrAuth/Results.php index df86e8c891e77f6ab9ef48a6c32c874cf1b2d249..763bcc3dc0dc26f316ee8706da9042d32c2b0363 100644 --- a/module/VuFind/src/VuFind/Search/SolrAuth/Results.php +++ b/module/VuFind/src/VuFind/Search/SolrAuth/Results.php @@ -42,17 +42,9 @@ use VuFindSearch\Service as SearchService; class Results extends \VuFind\Search\Solr\Results { /** - * Constructor + * Search backend identifier. * - * @param \VuFind\Search\Base\Params $params Object representing user - * search parameters. - * @param SearchService $searchService Search service - * @param Loader $recordLoader Record loader + * @var string */ - public function __construct(\VuFind\Search\Base\Params $params, - SearchService $searchService, Loader $recordLoader - ) { - parent::__construct($params, $searchService, $recordLoader); - $this->backendId = 'SolrAuth'; - } + protected $backendId = 'SolrAuth'; } diff --git a/module/VuFind/src/VuFind/Search/SolrReserves/Results.php b/module/VuFind/src/VuFind/Search/SolrReserves/Results.php index 404b235784347d0e17a09f346103fcd09eee8cee..68d5d4c134268f431ff1487f2f9c5170cdb5001d 100644 --- a/module/VuFind/src/VuFind/Search/SolrReserves/Results.php +++ b/module/VuFind/src/VuFind/Search/SolrReserves/Results.php @@ -44,17 +44,9 @@ use VuFindSearch\Service as SearchService; class Results extends \VuFind\Search\Solr\Results { /** - * Constructor + * Search backend identifier. * - * @param \VuFind\Search\Base\Params $params Object representing user - * search parameters. - * @param SearchService $searchService Search service - * @param Loader $recordLoader Record loader + * @var string */ - public function __construct(\VuFind\Search\Base\Params $params, - SearchService $searchService, Loader $recordLoader - ) { - parent::__construct($params, $searchService, $recordLoader); - $this->backendId = 'SolrReserves'; - } + protected $backendId = 'SolrReserves'; } diff --git a/module/VuFind/src/VuFind/Search/SolrWeb/Results.php b/module/VuFind/src/VuFind/Search/SolrWeb/Results.php index df4f375295ce07c2ca84ead5eae8f997299db5e0..a2d3954dc4f72c75da3842f758ac3f87b47266bc 100644 --- a/module/VuFind/src/VuFind/Search/SolrWeb/Results.php +++ b/module/VuFind/src/VuFind/Search/SolrWeb/Results.php @@ -42,17 +42,9 @@ use VuFindSearch\Service as SearchService; class Results extends \VuFind\Search\Solr\Results { /** - * Constructor + * Search backend identifier. * - * @param \VuFind\Search\Base\Params $params Object representing user - * search parameters. - * @param SearchService $searchService Search service - * @param Loader $recordLoader Record loader + * @var string */ - public function __construct(\VuFind\Search\Base\Params $params, - SearchService $searchService, Loader $recordLoader - ) { - parent::__construct($params, $searchService, $recordLoader); - $this->backendId = 'SolrWeb'; - } + protected $backendId = 'SolrWeb'; } diff --git a/module/VuFind/src/VuFind/Search/Summon/Results.php b/module/VuFind/src/VuFind/Search/Summon/Results.php index 24ca9fa5d3201099111532e60b619fcef74b8a43..30498f2e85c75891b62e6517d98b347d8ae321e3 100644 --- a/module/VuFind/src/VuFind/Search/Summon/Results.php +++ b/module/VuFind/src/VuFind/Search/Summon/Results.php @@ -66,6 +66,13 @@ class Results extends \VuFind\Search\Base\Results */ protected $topicRecommendations = false; + /** + * Search backend identifier. + * + * @var string + */ + protected $backendId = 'Summon'; + /** * Support method for performAndProcessSearch -- perform a search based on the * parameters passed to the object. @@ -79,7 +86,7 @@ class Results extends \VuFind\Search\Base\Results $offset = $this->getStartRecord() - 1; $params = $this->getParams()->getBackendParameters(); $collection = $this->getSearchService()->search( - 'Summon', $query, $offset, $limit, $params + $this->backendId, $query, $offset, $limit, $params ); $this->responseFacets = $collection->getFacets(); @@ -368,7 +375,7 @@ class Results extends \VuFind\Search\Base\Results } $params = $params->getBackendParameters(); $collection = $this->getSearchService()->search( - 'Summon', $query, 0, 0, $params + $this->backendId, $query, 0, 0, $params ); $facets = $collection->getFacets(); diff --git a/module/VuFind/src/VuFind/Search/WorldCat/Results.php b/module/VuFind/src/VuFind/Search/WorldCat/Results.php index 8b98ffa18027aa693f4228c769691ccb8bce5d60..6074036b01c497335df9ed6f2721ec132dfede39 100644 --- a/module/VuFind/src/VuFind/Search/WorldCat/Results.php +++ b/module/VuFind/src/VuFind/Search/WorldCat/Results.php @@ -38,6 +38,13 @@ namespace VuFind\Search\WorldCat; */ class Results extends \VuFind\Search\Base\Results { + /** + * Search backend identifier. + * + * @var string + */ + protected $backendId = 'WorldCat'; + /** * Support method for performAndProcessSearch -- perform a search based on the * parameters passed to the object. @@ -51,7 +58,7 @@ class Results extends \VuFind\Search\Base\Results $offset = $this->getStartRecord(); $params = $this->getParams()->getBackendParameters(); $collection = $this->getSearchService() - ->search('WorldCat', $query, $offset, $limit, $params); + ->search($this->backendId, $query, $offset, $limit, $params); $this->resultTotal = $collection->getTotal(); $this->results = $collection->getRecords();