mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-10 09:56:13 +01:00
tea/Classes/Domain/Repository/Traits/StoragePageAgnosticTrait.php
Łukasz Uznański 4bde411dd8
[TASK] Remove author annotations (#294)
Co-authored-by: Łukasz Uznański <l.uznanski@macopedia.com>
2021-09-07 08:51:11 +02:00

24 lines
709 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
*/
trait StoragePageAgnosticTrait
{
public function initializeObject(): void
{
/** @var QuerySettingsInterface $querySettings */
$querySettings = $this->objectManager->get(QuerySettingsInterface::class);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
}
}