mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-25 14:36:13 +01:00
3f3c9285d9
Resolves: #21
26 lines
763 B
PHP
26 lines
763 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace TTN\Tea\Domain\Repository\Traits;
|
|
|
|
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
|
|
use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
|
|
|
|
/**
|
|
* This trait for repositories makes the repository ignore the storage page setting when fetching models.
|
|
*
|
|
* @property ObjectManagerInterface $objectManager
|
|
*
|
|
* @author Oliver Klee <typo3-coding@oliverklee.de
|
|
*/
|
|
trait StoragePageAgnosticTrait
|
|
{
|
|
public function initializeObject(): void
|
|
{
|
|
/** @var QuerySettingsInterface $querySettings */
|
|
$querySettings = $this->objectManager->get(QuerySettingsInterface::class);
|
|
$querySettings->setRespectStoragePage(false);
|
|
$this->setDefaultQuerySettings($querySettings);
|
|
}
|
|
}
|