-
-
Save htuscher/b3663585b6a12466acd5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Vendor\Extension\Domain\Repository; | |
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; | |
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; | |
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; | |
class MyRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { | |
/** | |
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManager | |
* @inject | |
*/ | |
protected $configurationManager; | |
/** | |
* Set default query settings | |
*/ | |
public function initializeObject() { | |
/** @var $defaultQuerySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */ | |
$defaultQuerySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings'); | |
// add the pid constraint | |
$defaultQuerySettings->setRespectStoragePage(FALSE); | |
$defaultQuerySettings->setRespectSysLanguage(FALSE); | |
$this->setDefaultQuerySettings($defaultQuerySettings); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment