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 * Record interface file.
5 *
6 * PHP version 8
7 *
8 * Copyright (C) Villanova University 2010.
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 Search
24 * @package  Service
25 * @author   David Maus <maus@hab.de>
26 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
27 * @link     https://vufind.org/wiki/development
28 */
29
30namespace VuFindSearch\Response;
31
32/**
33 * Record interface.
34 *
35 * Every record must implement this.
36 *
37 * @category Search
38 * @package  Service
39 * @author   David Maus <maus@hab.de>
40 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
41 * @link     https://vufind.org/wiki/development
42 */
43interface RecordInterface
44{
45    /**
46     * Set the source backend identifier.
47     *
48     * @param string $identifier Backend identifier
49     *
50     * @return void
51     *
52     * @deprecated Use setSourceIdentifiers instead
53     */
54    public function setSourceIdentifier($identifier);
55
56    /**
57     * Set the source backend identifiers.
58     *
59     * @param string $recordSourceId  Record source identifier
60     * @param string $searchBackendId Search backend identifier (if different from
61     * $recordSourceId)
62     *
63     * @return void
64     */
65    public function setSourceIdentifiers($recordSourceId, $searchBackendId = '');
66
67    /**
68     * Return the source backend identifier.
69     *
70     * @return string
71     */
72    public function getSourceIdentifier();
73
74    /**
75     * Return the search backend identifier used to find the record.
76     *
77     * @return string
78     */
79    public function getSearchBackendIdentifier();
80
81    /**
82     * Add a label for the record
83     *
84     * @param string $label Label, may be a translation key
85     * @param string $class Label class
86     *
87     * @return void
88     */
89    public function addLabel(string $label, string $class);
90
91    /**
92     * Set the labels for the record
93     *
94     * @param array $labels An array of associative arrays with keys 'label' and
95     * 'class'
96     *
97     * @return void
98     */
99    public function setLabels(array $labels);
100
101    /**
102     * Return all labels for the record
103     *
104     * @return array An array of associative arrays with keys 'label' and 'class'
105     */
106    public function getLabels();
107}