Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 8
CRAP
0.00% covered (danger)
0.00%
0 / 1
SolrReserves
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 8
90
0.00% covered (danger)
0.00%
0 / 1
 getInstructor
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getInstructorId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getCourse
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getCourseId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDepartment
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDepartmentId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getItemCount
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
 getItemIds
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3/**
4 * Model for Solr reserves records.
5 *
6 * PHP version 8
7 *
8 * Copyright (C) Villanova University 2011.
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  RecordDrivers
25 * @author   Demian Katz <demian.katz@villanova.edu>
26 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
27 * @link     https://vufind.org/wiki/development:plugins:record_drivers Wiki
28 */
29
30namespace VuFind\RecordDriver;
31
32use function count;
33
34/**
35 * Model for Solr reserves records.
36 *
37 * @category VuFind
38 * @package  RecordDrivers
39 * @author   Demian Katz <demian.katz@villanova.edu>
40 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
41 * @link     https://vufind.org/wiki/development:plugins:record_drivers Wiki
42 */
43class SolrReserves extends SolrDefault
44{
45    /**
46     * Get the instructor.
47     *
48     * @return string
49     */
50    public function getInstructor()
51    {
52        return $this->fields['instructor'] ?? '';
53    }
54
55    /**
56     * Get the instructor ID.
57     *
58     * @return string
59     */
60    public function getInstructorId()
61    {
62        return $this->fields['instructor_id'] ?? '';
63    }
64
65    /**
66     * Get the course.
67     *
68     * @return string
69     */
70    public function getCourse()
71    {
72        return $this->fields['course'] ?? '';
73    }
74
75    /**
76     * Get the course ID.
77     *
78     * @return string
79     */
80    public function getCourseId()
81    {
82        return $this->fields['course_id'] ?? '';
83    }
84
85    /**
86     * Get the department.
87     *
88     * @return string
89     */
90    public function getDepartment()
91    {
92        return $this->fields['department'] ?? '';
93    }
94
95    /**
96     * Get the department ID.
97     *
98     * @return string
99     */
100    public function getDepartmentId()
101    {
102        return $this->fields['department_id'] ?? '';
103    }
104
105    /**
106     * Get a count of items associated with this record.
107     *
108     * @return int
109     */
110    public function getItemCount()
111    {
112        return isset($this->fields['bib_id'])
113            ? count($this->fields['bib_id']) : 0;
114    }
115
116    /**
117     * Get the list of attached reserves.
118     *
119     * @return array
120     */
121    public function getItemIds()
122    {
123        return $this->fields['bib_id'] ?? [];
124    }
125}