forked from TYPO3-Solr/ext-solr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[!!!][FEATURE] Rework Search Component system
All Search Components have been reworked and the Component system have been moved to a PSR-14 Event `AfterSearchQueryHasBeenPreparedEvent`. This way, the registration works just as other PSR-14 events, and Dependency Injection is now used consistently across all Componenents. The Component System is now merged with the previous hook `$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifySearchQuery']` and the `ApacheSolrForTypo3\Solr\Search\Modifier` interface. Two other hooks have been migrated as well. Tests who actually tested the registration have been removed, further existing tests have been adapted. Fixes: TYPO3-Solr#3675
- Loading branch information
Showing
40 changed files
with
932 additions
and
1,555 deletions.
There are no files selected for viewing
66 changes: 0 additions & 66 deletions
66
Classes/Domain/Search/LastSearches/LastSearchesWriterProcessor.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
Classes/Event/Search/AfterInitialSearchResultSetHasBeenCreatedEvent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace ApacheSolrForTypo3\Solr\Event\Search; | ||
|
||
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\SearchResultSet; | ||
use ApacheSolrForTypo3\Solr\Domain\Search\SearchRequest; | ||
use ApacheSolrForTypo3\Solr\Search; | ||
use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration; | ||
|
||
/** | ||
* Event which is used when the searchResultSet has been created and by the SearchQuery. | ||
* | ||
* Previously used via | ||
* $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['beforeSearch'] | ||
*/ | ||
final class AfterInitialSearchResultSetHasBeenCreatedEvent | ||
{ | ||
public function __construct( | ||
private SearchResultSet $searchResultSet, | ||
private readonly SearchRequest $searchRequest, | ||
private readonly Search $search, | ||
private readonly TypoScriptConfiguration $typoScriptConfiguration | ||
) { | ||
} | ||
|
||
public function getSearchResultSet(): SearchResultSet | ||
{ | ||
return $this->searchResultSet; | ||
} | ||
|
||
public function setSearchResultSet(SearchResultSet $searchResultSet): void | ||
{ | ||
$this->searchResultSet = $searchResultSet; | ||
} | ||
|
||
public function getSearchRequest(): SearchRequest | ||
{ | ||
return $this->searchRequest; | ||
} | ||
|
||
public function getSearch(): Search | ||
{ | ||
return $this->search; | ||
} | ||
|
||
public function getTypoScriptConfiguration(): TypoScriptConfiguration | ||
{ | ||
return $this->typoScriptConfiguration; | ||
} | ||
} |
Oops, something went wrong.