mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-12-24 13:46:10 +01:00
tea/Classes/Domain/Repository/Traits/StoragePageAgnosticTrait.php
Oliver Klee 3401e32a84
[FEATURE] Add PHP-CS-Fixer (#53)
Also run the fixer on all classes and tests.
2019-08-12 17:25:59 +02:00

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