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 * Search backend interface definition.
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 VuFind
24 * @package  Search
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
28 */
29
30namespace VuFindSearch\Backend;
31
32use VuFindSearch\ParamBag;
33use VuFindSearch\Query\AbstractQuery;
34
35/**
36 * Search backend interface definition.
37 *
38 * @category VuFind
39 * @package  Search
40 * @author   David Maus <maus@hab.de>
41 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
42 * @link     https://vufind.org
43 */
44interface BackendInterface
45{
46    /**
47     * Set the backend identifier.
48     *
49     * @param string $identifier Backend identifier
50     *
51     * @return void
52     */
53    public function setIdentifier($identifier);
54
55    /**
56     * Return backend identifier.
57     *
58     * @return string
59     */
60    public function getIdentifier();
61
62    /**
63     * Perform a search and return record collection.
64     *
65     * @param AbstractQuery $query  Search query
66     * @param int           $offset Search offset
67     * @param int           $limit  Search limit
68     * @param ParamBag      $params Search backend parameters
69     *
70     * @return \VuFindSearch\Response\RecordCollectionInterface
71     */
72    public function search(
73        AbstractQuery $query,
74        $offset,
75        $limit,
76        ParamBag $params = null
77    );
78
79    /**
80     * Retrieve a single document.
81     *
82     * @param string   $id     Document identifier
83     * @param ParamBag $params Search backend parameters
84     *
85     * @return \VuFindSearch\Response\RecordCollectionInterface
86     */
87    public function retrieve($id, ParamBag $params = null);
88}