Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * Interface for ILS Drivers
5 *
6 * PHP version 8
7 *
8 * Copyright (C) Villanova University 2007.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2,
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 *
23 * @category VuFind
24 * @package  ILS_Drivers
25 * @author   Andrew S. Nagy <vufind-tech@lists.sourceforge.net>
26 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
27 * @link     https://vufind.org/wiki/development:plugins:ils_drivers Wiki
28 */
29
30namespace VuFind\ILS\Driver;
31
32/**
33 * Catalog Specific Driver Class
34 *
35 * This interface class is the definition of the required methods for
36 * interacting with the local catalog.
37 *
38 * The parameters are of no major concern as you can define the purpose of the
39 * parameters for each method for whatever purpose your driver needs.
40 * The most important element here is what the method will return. All methods
41 * may throw exceptions in case of errors.
42 *
43 * @category VuFind
44 * @package  ILS_Drivers
45 * @author   Andrew S. Nagy <vufind-tech@lists.sourceforge.net>
46 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
47 * @link     https://vufind.org/wiki/development:plugins:ils_drivers Wiki
48 */
49interface DriverInterface
50{
51    /**
52     * Set configuration.
53     *
54     * Set the configuration for the driver.
55     *
56     * @param array $config Configuration array (usually loaded from a VuFind .ini
57     * file whose name corresponds with the driver class name).
58     *
59     * @return void
60     */
61    public function setConfig($config);
62
63    /**
64     * Initialize the driver.
65     *
66     * Validate configuration and perform all resource-intensive tasks needed to
67     * make the driver active.
68     *
69     * @return void
70     */
71    public function init();
72
73    /**
74     * Get Status
75     *
76     * This is responsible for retrieving the status information of a certain
77     * record.
78     *
79     * @param string $id The record id to retrieve the holdings for
80     *
81     * @throws \VuFind\Exception\ILS
82     * @return mixed     On success, an associative array with the following keys:
83     * id, availability (boolean), status, location, reserve, callnumber.
84     */
85    public function getStatus($id);
86
87    /**
88     * Get Statuses
89     *
90     * This is responsible for retrieving the status information for a
91     * collection of records.
92     *
93     * @param array $ids The array of record ids to retrieve the status for
94     *
95     * @throws \VuFind\Exception\ILS
96     * @return array     An array of getStatus() return values on success.
97     */
98    public function getStatuses($ids);
99
100    /**
101     * Get Holding
102     *
103     * This is responsible for retrieving the holding information of a certain
104     * record.
105     *
106     * @param string $id      The record id to retrieve the holdings for
107     * @param array  $patron  Patron data
108     * @param array  $options Extra options
109     *
110     * @throws \VuFind\Exception\ILS
111     * @return array         On success, an associative array with the following
112     * keys: id, availability (boolean), status, location, reserve, callnumber,
113     * duedate, number, barcode.
114     */
115    public function getHolding($id, array $patron = null, array $options = []);
116
117    /**
118     * Get Purchase History
119     *
120     * This is responsible for retrieving the acquisitions history data for the
121     * specific record (usually recently received issues of a serial).
122     *
123     * @param string $id The record id to retrieve the info for
124     *
125     * @throws \VuFind\Exception\ILS
126     * @return array     An array with the acquisitions data on success.
127     */
128    public function getPurchaseHistory($id);
129}