mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-09 23:56:14 +01:00
[TASK] Stop injecting query settings (#650)
This commit is contained in:
parent
a9f25fbb66
commit
19b8c4ef47
2 changed files with 4 additions and 10 deletions
|
@ -27,6 +27,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
||||||
- Drop support for PHP 7.2 and 7.3 (#581)
|
- Drop support for PHP 7.2 and 7.3 (#581)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Stop injecting QuerySettings (#650)
|
||||||
- Do not check `composer.lock` during `composer normalize` (#641)
|
- Do not check `composer.lock` during `composer normalize` (#641)
|
||||||
- Require TYPO3 >= 11.5.4 (#643)
|
- Require TYPO3 >= 11.5.4 (#643)
|
||||||
- Stop relying on transitive dependencies for `psr/http-message` (#613)
|
- Stop relying on transitive dependencies for `psr/http-message` (#613)
|
||||||
|
|
|
@ -4,24 +4,17 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace TTN\Tea\Domain\Repository\Traits;
|
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.
|
* This trait for repositories makes the repository ignore the storage page setting when fetching models.
|
||||||
*/
|
*/
|
||||||
trait StoragePageAgnosticTrait
|
trait StoragePageAgnosticTrait
|
||||||
{
|
{
|
||||||
private QuerySettingsInterface $querySettings;
|
|
||||||
|
|
||||||
public function injectQuerySettings(QuerySettingsInterface $querySettings): void
|
|
||||||
{
|
|
||||||
$this->querySettings = $querySettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function initializeObject(): void
|
public function initializeObject(): void
|
||||||
{
|
{
|
||||||
$querySettings = clone $this->querySettings;
|
$querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class);
|
||||||
|
|
||||||
$querySettings->setRespectStoragePage(false);
|
$querySettings->setRespectStoragePage(false);
|
||||||
$this->setDefaultQuerySettings($querySettings);
|
$this->setDefaultQuerySettings($querySettings);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue