Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Params
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 getBackendParameters
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
 getEpfView
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3/**
4 * EPF API Params
5 *
6 * PHP version 8
7 *
8 * Copyright (C) EBSCO Industries 2013
9 * Copyright (C) The National Library of Finland 2022
10 * Copyright (C) Villanova University 2023
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 *
25 * @category VuFind
26 * @package  EBSCO
27 * @author   Michelle Milton <mmilton@epnet.com>
28 * @author   Ere Maijala <ere.maijala@helsinki.fi>
29 * @author   Maccabee Levine <msl321@lehigh.edu>
30 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
31 * @link     https://vufind.org Main Page
32 */
33
34namespace VuFind\Search\EPF;
35
36use VuFindSearch\ParamBag;
37
38/**
39 * EPF API Params
40 *
41 * @category VuFind
42 * @package  EBSCO
43 * @author   Michelle Milton <mmilton@epnet.com>
44 * @author   Ere Maijala <ere.maijala@helsinki.fi>
45 * @author   Maccabee Levine <msl321@lehigh.edu>
46 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
47 * @link     https://vufind.org Main Page
48 */
49class Params extends \VuFind\Search\EDS\AbstractEDSParams
50{
51    /**
52     * Create search backend parameters for advanced features.
53     *
54     * @return ParamBag
55     */
56    public function getBackendParameters()
57    {
58        $backendParams = new ParamBag();
59
60        // The documentation says that 'view' is optional,
61        // but omitting it causes an error.
62        // https://connect.ebsco.com/s/article/Publication-Finder-API-Reference-Guide-Search
63        $view = $this->getEpfView();
64        $backendParams->set('view', $view);
65
66        $this->createBackendFilterParameters($backendParams);
67
68        return $backendParams;
69    }
70
71    /**
72     * Return the value for which search view we use
73     *
74     * @return string
75     */
76    public function getEpfView()
77    {
78        return $this->options->getEpfView();
79    }
80}