Skip to content
Snippets Groups Projects
Commit e03b486e authored by Kevin von Spiczak's avatar Kevin von Spiczak
Browse files

[TASK] set storage pids manually

parent 7901f2b7
No related branches found
No related tags found
1 merge request!46AZM changes
......@@ -27,6 +27,10 @@
namespace SGalinski\SgJobs\Domain\Repository;
use SGalinski\SgJobs\Domain\Model\Job;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException;
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
......@@ -42,9 +46,19 @@ class JobRepository extends Repository {
public const ORDER_BY_CRDATE = 2;
public const ORDER_BY_SORTING = 1;
/**
* @param ObjectManagerInterface $objectManager
* @throws InvalidConfigurationTypeException
*/
public function __construct(ObjectManagerInterface $objectManager) {
parent::__construct($objectManager);
$configurationManager = $objectManager->get(ConfigurationManager::class);
$querySettings = $objectManager->get(Typo3QuerySettings::class);
$storagePids = GeneralUtility::trimExplode(
',', $configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
)['persistence']['storagePid']);
$querySettings->setStoragePageIds($storagePids);
$querySettings->setRespectStoragePage(TRUE);
$this->setDefaultQuerySettings($querySettings);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment