TYPO3 CMS  TYPO3_6-2
QueryFactory.php
Go to the documentation of this file.
1 <?php
3 
20 
25  protected $objectManager;
26 
32 
37  protected $dataMapper;
38 
46  public function create($className) {
47  $query = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface', $className);
48  $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
49 
50  $dataMap = $this->dataMapper->getDataMap($className);
51  if ($dataMap->getIsStatic() || $dataMap->getRootLevel()) {
52  $querySettings->setRespectStoragePage(FALSE);
53  }
54 
55  $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
56  $querySettings->setStoragePageIds(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $frameworkConfiguration['persistence']['storagePid']));
57  if ($querySettings instanceof Typo3QuerySettings) {
58  $querySettings->useQueryCache($frameworkConfiguration['persistence']['useQueryCache']);
59  }
60  $query->setQuerySettings($querySettings);
61  return $query;
62  }
63 }
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)