1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* (c) Kitodo. Key to digital objects e.V. <[email protected]> |
5
|
|
|
* |
6
|
|
|
* This file is part of the Kitodo and TYPO3 projects. |
7
|
|
|
* |
8
|
|
|
* @license GNU General Public License version 3 or later. |
9
|
|
|
* For the full copyright and license information, please read the |
10
|
|
|
* LICENSE.txt file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
namespace Kitodo\Dlf\Common\Solr\SearchResult; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Page class for the 'dlf' extension. It keeps page in which search phrase was found. |
17
|
|
|
* |
18
|
|
|
* @package TYPO3 |
19
|
|
|
* @subpackage dlf |
20
|
|
|
* |
21
|
|
|
* @access public |
22
|
|
|
*/ |
23
|
|
|
class Page |
24
|
|
|
{ |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @access private |
28
|
|
|
* @var int The identifier of the page |
29
|
|
|
*/ |
30
|
|
|
private int $id; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @access private |
34
|
|
|
* @var string The name of the page |
35
|
|
|
*/ |
36
|
|
|
private string $name; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @access private |
40
|
|
|
* @var int The width of found page |
41
|
|
|
*/ |
42
|
|
|
private int $width; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @access private |
46
|
|
|
* @var int The height of found page |
47
|
|
|
*/ |
48
|
|
|
private int $height; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* The constructor for region. |
52
|
|
|
* |
53
|
|
|
* @access public |
54
|
|
|
* |
55
|
|
|
* @param int $id: Id of found page properties |
56
|
|
|
* @param array $page: Array of found page properties |
57
|
|
|
* |
58
|
|
|
* @return void |
59
|
|
|
*/ |
60
|
|
|
public function __construct(int $id, array $page) |
61
|
|
|
{ |
62
|
|
|
$this->id = $id; |
63
|
|
|
$this->name = $page['id']; |
64
|
|
|
$this->width = $page['width']; |
65
|
|
|
$this->height = $page['height']; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Get the page's identifier. |
70
|
|
|
* |
71
|
|
|
* @access public |
72
|
|
|
* |
73
|
|
|
* @return int The page's identifier |
74
|
|
|
*/ |
75
|
|
|
public function getId(): int |
76
|
|
|
{ |
77
|
|
|
return $this->id; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* Get the page's name. |
82
|
|
|
* |
83
|
|
|
* @access public |
84
|
|
|
* |
85
|
|
|
* @return string The page's name |
86
|
|
|
*/ |
87
|
|
|
public function getName(): string |
88
|
|
|
{ |
89
|
|
|
return $this->name; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* Get the page's width. |
94
|
|
|
* |
95
|
|
|
* @access public |
96
|
|
|
* |
97
|
|
|
* @return int The page's width |
98
|
|
|
*/ |
99
|
|
|
public function getWidth(): int |
100
|
|
|
{ |
101
|
|
|
return $this->width; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* Get the page's height. |
106
|
|
|
* |
107
|
|
|
* @access public |
108
|
|
|
* |
109
|
|
|
* @return int The page's height |
110
|
|
|
*/ |
111
|
|
|
public function getHeight(): int |
112
|
|
|
{ |
113
|
|
|
return $this->height; |
114
|
|
|
} |
115
|
|
|
} |
116
|
|
|
|