1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
/* |
5
|
|
|
* This file is part of the TYPO3 CMS project. |
6
|
|
|
* |
7
|
|
|
* It is free software; you can redistribute it and/or modify it under |
8
|
|
|
* the terms of the GNU General Public License, either version 2 |
9
|
|
|
* of the License, or any later version. |
10
|
|
|
* |
11
|
|
|
* For the full copyright and license information, please read the |
12
|
|
|
* LICENSE.txt file that was distributed with this source code. |
13
|
|
|
* |
14
|
|
|
* The TYPO3 project - inspiring people to share! |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
namespace ApacheSolrForTypo3\Solr\Event\Search; |
18
|
|
|
|
19
|
|
|
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; |
20
|
|
|
use ApacheSolrForTypo3\Solr\Pagination\ResultsPagination; |
21
|
|
|
|
22
|
|
|
class AfterSearchEvent |
23
|
|
|
{ |
24
|
|
|
private SearchResultSet $resultSet; |
25
|
|
|
private array $additionalFilters; |
26
|
|
|
private string $pluginNamespace; |
27
|
|
|
private array $arguments; |
28
|
|
|
private ResultsPagination $pagination; |
29
|
|
|
private int $currentPage; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @param SearchResultSet $resultSet |
33
|
|
|
* @param array $additionalFilters |
34
|
|
|
* @param string $pluginNamespace |
35
|
|
|
* @param array $arguments |
36
|
|
|
* @param ResultsPagination $pagination |
37
|
|
|
* @param int $currentPage |
38
|
|
|
*/ |
39
|
|
|
public function __construct( |
40
|
|
|
SearchResultSet $resultSet, |
41
|
|
|
array $additionalFilters, |
42
|
|
|
string $pluginNamespace, |
43
|
|
|
array $arguments, |
44
|
|
|
ResultsPagination $pagination, |
45
|
|
|
int $currentPage |
46
|
|
|
) { |
47
|
|
|
$this->resultSet = $resultSet; |
48
|
|
|
$this->additionalFilters = $additionalFilters; |
49
|
|
|
$this->pluginNamespace = $pluginNamespace; |
50
|
|
|
$this->arguments = $arguments; |
51
|
|
|
$this->pagination = $pagination; |
52
|
|
|
$this->currentPage = $currentPage; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @return SearchResultSet |
57
|
|
|
*/ |
58
|
|
|
public function getResultSet(): SearchResultSet |
59
|
|
|
{ |
60
|
|
|
return $this->resultSet; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return array |
65
|
|
|
*/ |
66
|
|
|
public function getAdditionalFilters(): array |
67
|
|
|
{ |
68
|
|
|
return $this->additionalFilters; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @return string |
73
|
|
|
*/ |
74
|
|
|
public function getPluginNamespace(): string |
75
|
|
|
{ |
76
|
|
|
return $this->pluginNamespace; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @return array |
81
|
|
|
*/ |
82
|
|
|
public function getArguments(): array |
83
|
|
|
{ |
84
|
|
|
return $this->arguments; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @return ResultsPagination |
89
|
|
|
*/ |
90
|
|
|
public function getPagination(): ResultsPagination |
91
|
|
|
{ |
92
|
|
|
return $this->pagination; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @return int |
97
|
|
|
*/ |
98
|
|
|
public function getCurrentPage(): int |
99
|
|
|
{ |
100
|
|
|
return $this->currentPage; |
101
|
|
|
} |
102
|
|
|
} |
103
|
|
|
|