Passed
Pull Request — task/3376-TYPO3_12_compatibili... (#3452)
by
unknown
45:45 queued 21s
created

AfterFacetParsedEvent::getFacetConfiguration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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\Parser;
18
19
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\AbstractFacet;
20
21
/**
22
 * This event is dispatched after an facet is parsed.
23
 *
24
 * @author Lars Tode <[email protected]>
25
 */
26
class AfterFacetParsedEvent
27
{
28
    private AbstractFacet $facet;
29
    private array $facetConfiguration;
30
31
    /**
32
     * @param AbstractFacet $facet
33
     * @param array $facetConfiguration
34
     */
35
    public function __construct(AbstractFacet $facet, array $facetConfiguration)
36
    {
37
        $this->facet = $facet;
38
        $this->facetConfiguration = $facetConfiguration;
39
    }
40
41
    /**
42
     * Returns the class name of the facet
43
     *
44
     * @return string
45
     */
46
    public function getFacetType(): string
47
    {
48
        return get_class($this->facet);
49
    }
50
51
    /**
52
     * @return AbstractFacet
53
     */
54
    public function getFacet(): AbstractFacet
55
    {
56
        return $this->facet;
57
    }
58
59
    /**
60
     * @return array
61
     */
62
    public function getFacetConfiguration(): array
63
    {
64
        return $this->facetConfiguration;
65
    }
66
}
67