mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-14 23:16:12 +01:00
27 lines
732 B
PHP
27 lines
732 B
PHP
|
<?php
|
||
|
declare(strict_types = 1);
|
||
|
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
|
||
|
{
|
||
|
/**
|
||
|
* Initializes this object.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function initializeObject()
|
||
|
{
|
||
|
/** @var QuerySettingsInterface $querySettings */
|
||
|
$querySettings = $this->objectManager->get(QuerySettingsInterface::class);
|
||
|
$querySettings->setRespectStoragePage(false);
|
||
|
$this->setDefaultQuerySettings($querySettings);
|
||
|
}
|
||
|
}
|