Passed
Push — master ( 203e1d...831cab )
by Timo
27:25
created

getSearchResultSet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
namespace ApacheSolrForTypo3\Solr\ViewHelpers;
3
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
use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration;
19
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet;
20
use ApacheSolrForTypo3\Solr\Mvc\Controller\SolrControllerContext;
21
use ApacheSolrForTypo3\Solr\ViewHelpers\AbstractSolrViewHelper;
22
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
23
24
/**
25
 * Class AbstractViewHelper
26
 *
27
 * @author Frans Saris <[email protected]>
28
 * @author Timo Hund <[email protected]>
29
 * @package ApacheSolrForTypo3\Solr\ViewHelpers
30
 */
31
abstract class AbstractSolrFrontendViewHelper extends AbstractSolrViewHelper
32
{
33
    /**
34
     * @var SolrControllerContext
35
     */
36
    protected $controllerContext;
37
38
    /**
39
     * @return TypoScriptConfiguration
40
     */
41
    protected function getTypoScriptConfiguration()
42
    {
43
        return $this->controllerContext->getTypoScriptConfiguration();
44
    }
45
46
    /**
47
     * @return SearchResultSet
48
     */
49
    protected function getSearchResultSet()
50
    {
51
        return $this->controllerContext->getSearchResultSet();
52
    }
53
54
    /**
55
     * @param RenderingContextInterface $renderingContext
56
     * @return SearchResultSet
57
     */
58 28
    protected static function getUsedSearchResultSetFromRenderingContext(RenderingContextInterface $renderingContext)
59
    {
60 28
        $resultSet = $renderingContext->getVariableProvider()->get('resultSet');
61 28
        return $resultSet;
62
    }
63
}
64