mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-22 13:16:19 +01:00

[TASK] Stop injecting query settings (#650)

This commit is contained in:
Łukasz Uznański 2022-10-18 23:21:20 +02:00 committed by GitHub
parent a9f25fbb66
commit 19b8c4ef47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View file

@ -27,6 +27,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Drop support for PHP 7.2 and 7.3 (#581)
### Fixed
- Stop injecting QuerySettings (#650)
- Do not check `composer.lock` during `composer normalize` (#641)
- Require TYPO3 >= 11.5.4 (#643)
- Stop relying on transitive dependencies for `psr/http-message` (#613)

View file

@ -4,24 +4,17 @@ declare(strict_types=1);
namespace TTN\Tea\Domain\Repository\Traits;
use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings;
/**
* This trait for repositories makes the repository ignore the storage page setting when fetching models.
*/
trait StoragePageAgnosticTrait
{
private QuerySettingsInterface $querySettings;
public function injectQuerySettings(QuerySettingsInterface $querySettings): void
{
$this->querySettings = $querySettings;
}
public function initializeObject(): void
{
$querySettings = clone $this->querySettings;
$querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
}