2018-05-25 16:19:12 +02:00
|
|
|
<?php
|
2019-12-07 12:13:32 +01:00
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-12-01 12:16:06 +01:00
|
|
|
namespace TTN\Tea\Domain\Repository\Traits;
|
2018-05-25 16:19:12 +02:00
|
|
|
|
2022-10-18 23:21:20 +02:00
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
|
|
use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings;
|
2018-05-25 16:19:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This trait for repositories makes the repository ignore the storage page setting when fetching models.
|
|
|
|
*/
|
|
|
|
trait StoragePageAgnosticTrait
|
|
|
|
{
|
2019-08-12 17:25:59 +02:00
|
|
|
public function initializeObject(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
2022-10-18 23:21:20 +02:00
|
|
|
$querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class);
|
2018-05-25 16:19:12 +02:00
|
|
|
$querySettings->setRespectStoragePage(false);
|
|
|
|
$this->setDefaultQuerySettings($querySettings);
|
|
|
|
}
|
|
|
|
}
|