Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
SolrWeb
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getBreadcrumb
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getUrl
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getLastModified
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 web 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
32/**
33 * Model for Solr web records.
34 *
35 * @category VuFind
36 * @package  RecordDrivers
37 * @author   Demian Katz <demian.katz@villanova.edu>
38 * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
39 * @link     https://vufind.org/wiki/development:plugins:record_drivers Wiki
40 */
41class SolrWeb extends SolrDefault
42{
43    /**
44     * Constructor
45     *
46     * @param \Laminas\Config\Config $mainConfig     VuFind main configuration (omit
47     * for built-in defaults)
48     * @param \Laminas\Config\Config $recordConfig   Record-specific configuration
49     * file (omit to use $mainConfig as $recordConfig)
50     * @param \Laminas\Config\Config $searchSettings Search-specific configuration
51     * file
52     */
53    public function __construct(
54        $mainConfig = null,
55        $recordConfig = null,
56        $searchSettings = null
57    ) {
58        $this->preferredSnippetFields = ['description', 'fulltext'];
59        parent::__construct($mainConfig, $recordConfig, $searchSettings);
60    }
61
62    /**
63     * Get text that can be displayed to represent this record in
64     * breadcrumbs.
65     *
66     * @return string Breadcrumb text to represent this record.
67     */
68    public function getBreadcrumb()
69    {
70        return $this->getTitle();
71    }
72
73    /**
74     * Get the URL for the current record.
75     *
76     * @return string
77     */
78    public function getUrl()
79    {
80        return $this->fields['url'];
81    }
82
83    /**
84     * Get the last modified date for the current record (or empty string if unset).
85     *
86     * @return string
87     */
88    public function getLastModified()
89    {
90        return $this->fields['last_modified'] ?? '';
91    }
92}