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\ViewHelpers; |
19
|
|
|
|
20
|
|
|
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Grouping\GroupItem; |
21
|
|
|
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; |
22
|
|
|
use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; |
23
|
|
|
use InvalidArgumentException; |
24
|
|
|
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Class AbstractSolrFrontendViewHelper |
28
|
|
|
* |
29
|
|
|
* @author Frans Saris <[email protected]> |
30
|
|
|
* @author Timo Hund <[email protected]> |
31
|
|
|
*/ |
32
|
|
|
abstract class AbstractSolrFrontendViewHelper extends AbstractSolrViewHelper |
33
|
|
|
{ |
34
|
|
|
/** |
35
|
|
|
* @return TypoScriptConfiguration|null |
36
|
|
|
*/ |
37
|
|
|
protected function getTypoScriptConfiguration(): ?TypoScriptConfiguration |
38
|
|
|
{ |
39
|
|
|
return $this->renderingContext->getVariableProvider()->get('typoScriptConfiguration'); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @return SearchResultSet|null |
44
|
|
|
*/ |
45
|
|
|
protected function getSearchResultSet(): ?SearchResultSet |
46
|
|
|
{ |
47
|
|
|
return $this->renderingContext->getVariableProvider()->get('searchResultSet'); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @param RenderingContextInterface $renderingContext |
52
|
|
|
* @return SearchResultSet|GroupItem|null |
53
|
|
|
*/ |
54
|
|
|
protected static function getUsedSearchResultSetFromRenderingContext( |
55
|
|
|
RenderingContextInterface $renderingContext |
56
|
|
|
) { |
57
|
|
|
return $renderingContext->getVariableProvider()->get('resultSet') |
58
|
|
|
?? $renderingContext->getControllerContext()->getSearchResultSet(); |
|
|
|
|
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.