TYPO3  7.6
Typo3QuerySettings.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Extbase\Persistence\Generic;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
26 {
32  protected $respectStoragePage = true;
33 
39  protected $storagePageIds = array();
40 
48  protected $ignoreEnableFields = false;
49 
56  protected $enableFieldsToBeIgnored = array();
57 
63  protected $includeDeleted = false;
64 
70  protected $respectSysLanguage = true;
71 
77  protected $languageOverlayMode = true;
78 
84  protected $languageMode = null;
85 
91  protected $languageUid = 0;
92 
98  protected $usePreparedStatement = false;
99 
105  protected $useQueryCache = true;
106 
111  public function initializeObject()
112  {
114  $objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
116  $configurationManager = $objectManager->get(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
117  if (TYPO3_MODE === 'BE' && $configurationManager->isFeatureEnabled('ignoreAllEnableFieldsInBe')) {
118  $this->setIgnoreEnableFields(true);
119  }
120 
121  // TYPO3 CMS language defaults
122  $this->setLanguageUid(0);
123  $this->setLanguageMode(null);
124  $this->setLanguageOverlayMode(false);
125 
126  // Set correct language uid for frontend handling
127  if (isset($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE'])) {
128  $this->setLanguageUid((int)$GLOBALS['TSFE']->sys_language_content);
129  $this->setLanguageOverlayMode($GLOBALS['TSFE']->sys_language_contentOL ?: false);
130  $this->setLanguageMode($GLOBALS['TSFE']->sys_language_mode ?: null);
131  } elseif ((int)GeneralUtility::_GP('L')) {
132  // Set language from 'L' parameter
133  $this->setLanguageUid((int)GeneralUtility::_GP('L'));
134  }
135  }
136 
145  {
146  $this->respectStoragePage = $respectStoragePage;
147  return $this;
148  }
149 
155  public function getRespectStoragePage()
156  {
158  }
159 
167  public function setStoragePageIds(array $storagePageIds)
168  {
169  $this->storagePageIds = $storagePageIds;
170  return $this;
171  }
172 
178  public function getStoragePageIds()
179  {
180  return $this->storagePageIds;
181  }
182 
189  {
190  $this->respectSysLanguage = $respectSysLanguage;
191  return $this;
192  }
193 
197  public function getRespectSysLanguage()
198  {
200  }
201 
208  {
209  $this->languageOverlayMode = $languageOverlayMode;
210  return $this;
211  }
212 
216  public function getLanguageOverlayMode()
217  {
219  }
220 
226  public function setLanguageMode($languageMode = '')
227  {
228  $this->languageMode = $languageMode;
229  return $this;
230  }
231 
235  public function getLanguageMode()
236  {
237  return $this->languageMode;
238  }
239 
245  public function setLanguageUid($languageUid)
246  {
247  $this->languageUid = $languageUid;
248  return $this;
249  }
250 
254  public function getLanguageUid()
255  {
256  return $this->languageUid;
257  }
258 
270  {
271  $this->ignoreEnableFields = $ignoreEnableFields;
272  return $this;
273  }
274 
284  public function getIgnoreEnableFields()
285  {
287  }
288 
300  {
301  $this->enableFieldsToBeIgnored = $enableFieldsToBeIgnored;
302  return $this;
303  }
304 
312  public function getEnableFieldsToBeIgnored()
313  {
315  }
316 
325  {
326  $this->includeDeleted = $includeDeleted;
327  return $this;
328  }
329 
335  public function getIncludeDeleted()
336  {
337  return $this->includeDeleted;
338  }
339 
345  {
347  return $this;
348  }
349 
353  public function getUsePreparedStatement()
354  {
355  return (bool)$this->usePreparedStatement;
356  }
357 
362  public function useQueryCache($useQueryCache)
363  {
364  $this->useQueryCache = (bool)$useQueryCache;
365  return $this;
366  }
367 
371  public function getUseQueryCache()
372  {
373  return $this->useQueryCache;
374  }
375 }