Passed
Push — task/3376-TYPO3_12_compatibili... ( b42ab1...4e0f1e )
by Rafael
49:28 queued 04:28
created

AfterSearchEvent   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
eloc 19
c 1
b 0
f 0
dl 0
loc 79
rs 10

7 Methods

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