‪TYPO3CMS  10.4
Typo3QuerySettings.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
24 
29 {
35  protected ‪$respectStoragePage = true;
36 
42  protected ‪$storagePageIds = [];
43 
51  protected ‪$ignoreEnableFields = false;
52 
59  protected ‪$enableFieldsToBeIgnored = [];
60 
66  protected ‪$includeDeleted = false;
67 
73  protected ‪$respectSysLanguage = true;
74 
80  protected ‪$languageOverlayMode = true;
81 
87  protected ‪$languageUid = 0;
88 
92  protected ‪$environmentService;
93 
98  {
99  $this->environmentService = ‪$environmentService;
100  }
101 
106  public function ‪initializeObject()
107  {
109  $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
111  $configurationManager = $objectManager->get(ConfigurationManagerInterface::class);
112  if ($this->environmentService->isEnvironmentInBackendMode() && $configurationManager->isFeatureEnabled('ignoreAllEnableFieldsInBe')) {
113  $this->‪setIgnoreEnableFields(true);
114  }
116  $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');
117  $this->‪setLanguageUid($languageAspect->getContentId());
118  $this->‪setLanguageOverlayMode(false);
119 
120  if ($this->environmentService->isEnvironmentInFrontendMode()) {
121  $overlayMode = $languageAspect->getLegacyOverlayType() === 'hideNonTranslated' ? 'hideNonTranslated' : (bool)$languageAspect->getLegacyOverlayType();
122  $this->‪setLanguageOverlayMode($overlayMode);
123  } elseif ((int)GeneralUtility::_GP('L')) {
124  // Set language from 'L' parameter
125  $this->‪setLanguageUid((int)GeneralUtility::_GP('L'));
126  }
127  }
128 
136  {
137  $this->respectStoragePage = ‪$respectStoragePage;
138  return $this;
139  }
140 
146  public function ‪getRespectStoragePage()
147  {
149  }
150 
157  public function ‪setStoragePageIds(array ‪$storagePageIds)
158  {
159  $this->storagePageIds = ‪$storagePageIds;
160  return $this;
161  }
162 
168  public function ‪getStoragePageIds()
169  {
171  }
172 
178  {
179  $this->respectSysLanguage = ‪$respectSysLanguage;
180  return $this;
181  }
182 
186  public function ‪getRespectSysLanguage()
187  {
189  }
190 
196  {
197  $this->languageOverlayMode = ‪$languageOverlayMode;
198  return $this;
199  }
200 
204  public function ‪getLanguageOverlayMode()
205  {
207  }
208 
215  public function ‪setLanguageMode($languageMode = '')
216  {
217  return $this;
218  }
219 
225  public function ‪getLanguageMode()
226  {
227  return null;
228  }
229 
235  {
236  $this->languageUid = ‪$languageUid;
237  return $this;
238  }
239 
243  public function ‪getLanguageUid()
244  {
245  return ‪$this->languageUid;
246  }
247 
258  {
259  $this->ignoreEnableFields = ‪$ignoreEnableFields;
260  return $this;
261  }
262 
272  public function ‪getIgnoreEnableFields()
273  {
275  }
276 
287  {
288  $this->enableFieldsToBeIgnored = ‪$enableFieldsToBeIgnored;
289  return $this;
290  }
291 
299  public function ‪getEnableFieldsToBeIgnored()
300  {
302  }
303 
311  {
312  $this->includeDeleted = ‪$includeDeleted;
313  return $this;
314  }
315 
321  public function ‪getIncludeDeleted()
322  {
324  }
325 }
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getIgnoreEnableFields
‪bool getIgnoreEnableFields()
Definition: Typo3QuerySettings.php:263
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getIncludeDeleted
‪bool getIncludeDeleted()
Definition: Typo3QuerySettings.php:312
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getRespectStoragePage
‪bool getRespectStoragePage()
Definition: Typo3QuerySettings.php:137
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$languageUid
‪int $languageUid
Definition: Typo3QuerySettings.php:79
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$respectStoragePage
‪bool $respectStoragePage
Definition: Typo3QuerySettings.php:34
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setLanguageOverlayMode
‪QuerySettingsInterface setLanguageOverlayMode($languageOverlayMode=false)
Definition: Typo3QuerySettings.php:186
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$languageOverlayMode
‪bool $languageOverlayMode
Definition: Typo3QuerySettings.php:73
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getLanguageOverlayMode
‪mixed getLanguageOverlayMode()
Definition: Typo3QuerySettings.php:195
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:28
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getEnableFieldsToBeIgnored
‪array getEnableFieldsToBeIgnored()
Definition: Typo3QuerySettings.php:290
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setIncludeDeleted
‪QuerySettingsInterface setIncludeDeleted($includeDeleted)
Definition: Typo3QuerySettings.php:301
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:53
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getStoragePageIds
‪array getStoragePageIds()
Definition: Typo3QuerySettings.php:159
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$environmentService
‪EnvironmentService $environmentService
Definition: Typo3QuerySettings.php:83
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setRespectSysLanguage
‪QuerySettingsInterface setRespectSysLanguage($respectSysLanguage)
Definition: Typo3QuerySettings.php:168
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$ignoreEnableFields
‪bool $ignoreEnableFields
Definition: Typo3QuerySettings.php:48
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$respectSysLanguage
‪bool $respectSysLanguage
Definition: Typo3QuerySettings.php:67
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$includeDeleted
‪bool $includeDeleted
Definition: Typo3QuerySettings.php:61
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$enableFieldsToBeIgnored
‪array $enableFieldsToBeIgnored
Definition: Typo3QuerySettings.php:55
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\injectEnvironmentService
‪injectEnvironmentService(EnvironmentService $environmentService)
Definition: Typo3QuerySettings.php:88
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getLanguageMode
‪string getLanguageMode()
Definition: Typo3QuerySettings.php:216
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setStoragePageIds
‪QuerySettingsInterface setStoragePageIds(array $storagePageIds)
Definition: Typo3QuerySettings.php:148
‪TYPO3\CMS\Core\Context\LanguageAspect
Definition: LanguageAspect.php:57
‪TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
Definition: QuerySettingsInterface.php:22
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$storagePageIds
‪array $storagePageIds
Definition: Typo3QuerySettings.php:40
‪TYPO3\CMS\Extbase\Persistence\Generic
Definition: Backend.php:16
‪TYPO3\CMS\Extbase\Service\EnvironmentService
Definition: EnvironmentService.php:27
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getLanguageUid
‪int getLanguageUid()
Definition: Typo3QuerySettings.php:234
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\initializeObject
‪initializeObject()
Definition: Typo3QuerySettings.php:97
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getRespectSysLanguage
‪bool getRespectSysLanguage()
Definition: Typo3QuerySettings.php:177
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setEnableFieldsToBeIgnored
‪QuerySettingsInterface setEnableFieldsToBeIgnored($enableFieldsToBeIgnored)
Definition: Typo3QuerySettings.php:277
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setRespectStoragePage
‪QuerySettingsInterface setRespectStoragePage($respectStoragePage)
Definition: Typo3QuerySettings.php:126
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setIgnoreEnableFields
‪QuerySettingsInterface setIgnoreEnableFields($ignoreEnableFields)
Definition: Typo3QuerySettings.php:248
‪TYPO3\CMS\Extbase\Object\ObjectManager
Definition: ObjectManager.php:28
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setLanguageMode
‪QuerySettingsInterface setLanguageMode($languageMode='')
Definition: Typo3QuerySettings.php:206
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings
Definition: Typo3QuerySettings.php:29
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setLanguageUid
‪QuerySettingsInterface setLanguageUid($languageUid)
Definition: Typo3QuerySettings.php:225