2018-05-25 16:19:12 +02:00
|
|
|
<?php
|
2019-08-12 17:25:59 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-05-25 16:19:12 +02:00
|
|
|
namespace OliverKlee\Tea\Domain\Repository\Traits;
|
|
|
|
|
|
|
|
use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This trait for repositories makes the repository ignore the storage page setting when fetching models.
|
|
|
|
*
|
|
|
|
* @author Oliver Klee <typo3-coding@oliverklee.de
|
|
|
|
*/
|
|
|
|
trait StoragePageAgnosticTrait
|
|
|
|
{
|
2019-08-12 17:25:59 +02:00
|
|
|
public function initializeObject(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
|
|
|
/** @var QuerySettingsInterface $querySettings */
|
|
|
|
$querySettings = $this->objectManager->get(QuerySettingsInterface::class);
|
|
|
|
$querySettings->setRespectStoragePage(false);
|
|
|
|
$this->setDefaultQuerySettings($querySettings);
|
|
|
|
}
|
|
|
|
}
|