‪TYPO3CMS  9.5
Typo3QuerySettings.php
Go to the documentation of this file.
1 <?php
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 
23 
28 {
34  protected ‪$respectStoragePage = true;
35 
41  protected ‪$storagePageIds = [];
42 
50  protected ‪$ignoreEnableFields = false;
51 
58  protected ‪$enableFieldsToBeIgnored = [];
59 
65  protected ‪$includeDeleted = false;
66 
72  protected ‪$respectSysLanguage = true;
73 
79  protected ‪$languageOverlayMode = true;
80 
88  protected ‪$languageMode;
89 
95  protected ‪$languageUid = 0;
96 
100  protected ‪$environmentService;
101 
106  {
107  $this->environmentService = ‪$environmentService;
108  }
109 
114  public function ‪initializeObject()
115  {
117  $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
119  $configurationManager = $objectManager->get(ConfigurationManagerInterface::class);
120  if ($this->environmentService->isEnvironmentInBackendMode() && $configurationManager->isFeatureEnabled('ignoreAllEnableFieldsInBe')) {
121  $this->‪setIgnoreEnableFields(true);
122  }
124  $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');
125  $this->‪setLanguageUid($languageAspect->getContentId());
126  $this->‪setLanguageOverlayMode(false);
127 
128  if ($this->environmentService->isEnvironmentInFrontendMode()) {
129  $overlayMode = $languageAspect->getLegacyOverlayType() === 'hideNonTranslated' ? 'hideNonTranslated' : (bool)$languageAspect->getLegacyOverlayType();
130  $this->‪setLanguageOverlayMode($overlayMode);
131  $this->‪setLanguageMode($languageAspect->getLegacyLanguageMode() ?: null);
132  } elseif ((int)GeneralUtility::_GP('L')) {
133  // Set language from 'L' parameter
134  $this->‪setLanguageUid((int)GeneralUtility::_GP('L'));
135  }
136  }
137 
145  {
146  $this->respectStoragePage = ‪$respectStoragePage;
147  return $this;
148  }
149 
155  public function ‪getRespectStoragePage()
156  {
158  }
159 
166  public function ‪setStoragePageIds(array ‪$storagePageIds)
167  {
168  $this->storagePageIds = ‪$storagePageIds;
169  return $this;
170  }
171 
177  public function ‪getStoragePageIds()
178  {
180  }
181 
187  {
188  $this->respectSysLanguage = ‪$respectSysLanguage;
189  return $this;
190  }
191 
195  public function ‪getRespectSysLanguage()
196  {
198  }
199 
204  public function ‪setLanguageOverlayMode(‪$languageOverlayMode = false)
205  {
206  $this->languageOverlayMode = ‪$languageOverlayMode;
207  return $this;
208  }
209 
213  public function ‪getLanguageOverlayMode()
214  {
216  }
217 
224  public function ‪setLanguageMode(‪$languageMode = '')
225  {
226  $this->languageMode = ‪$languageMode;
227  return $this;
228  }
229 
235  public function ‪getLanguageMode()
236  {
237  return ‪$this->languageMode;
238  }
239 
244  public function ‪setLanguageUid(‪$languageUid)
245  {
246  $this->languageUid = ‪$languageUid;
247  return $this;
248  }
249 
253  public function ‪getLanguageUid()
254  {
255  return ‪$this->languageUid;
256  }
257 
268  {
269  $this->ignoreEnableFields = ‪$ignoreEnableFields;
270  return $this;
271  }
272 
282  public function ‪getIgnoreEnableFields()
283  {
285  }
286 
297  {
298  $this->enableFieldsToBeIgnored = ‪$enableFieldsToBeIgnored;
299  return $this;
300  }
301 
309  public function ‪getEnableFieldsToBeIgnored()
310  {
312  }
313 
321  {
322  $this->includeDeleted = ‪$includeDeleted;
323  return $this;
324  }
325 
331  public function ‪getIncludeDeleted()
332  {
334  }
335 }
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getIgnoreEnableFields
‪bool getIgnoreEnableFields()
Definition: Typo3QuerySettings.php:272
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getIncludeDeleted
‪bool getIncludeDeleted()
Definition: Typo3QuerySettings.php:321
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getRespectStoragePage
‪bool getRespectStoragePage()
Definition: Typo3QuerySettings.php:145
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$languageUid
‪int $languageUid
Definition: Typo3QuerySettings.php:86
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$respectStoragePage
‪bool $respectStoragePage
Definition: Typo3QuerySettings.php:33
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setLanguageOverlayMode
‪QuerySettingsInterface setLanguageOverlayMode($languageOverlayMode=false)
Definition: Typo3QuerySettings.php:194
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getLanguageOverlayMode
‪mixed getLanguageOverlayMode()
Definition: Typo3QuerySettings.php:203
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:22
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getEnableFieldsToBeIgnored
‪array getEnableFieldsToBeIgnored()
Definition: Typo3QuerySettings.php:299
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setIncludeDeleted
‪QuerySettingsInterface setIncludeDeleted($includeDeleted)
Definition: Typo3QuerySettings.php:310
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:49
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getStoragePageIds
‪array getStoragePageIds()
Definition: Typo3QuerySettings.php:167
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$environmentService
‪EnvironmentService $environmentService
Definition: Typo3QuerySettings.php:90
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setRespectSysLanguage
‪QuerySettingsInterface setRespectSysLanguage($respectSysLanguage)
Definition: Typo3QuerySettings.php:176
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$ignoreEnableFields
‪bool $ignoreEnableFields
Definition: Typo3QuerySettings.php:47
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$respectSysLanguage
‪bool $respectSysLanguage
Definition: Typo3QuerySettings.php:66
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$includeDeleted
‪bool $includeDeleted
Definition: Typo3QuerySettings.php:60
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$enableFieldsToBeIgnored
‪array $enableFieldsToBeIgnored
Definition: Typo3QuerySettings.php:54
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\injectEnvironmentService
‪injectEnvironmentService(EnvironmentService $environmentService)
Definition: Typo3QuerySettings.php:95
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getLanguageMode
‪string getLanguageMode()
Definition: Typo3QuerySettings.php:225
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setStoragePageIds
‪QuerySettingsInterface setStoragePageIds(array $storagePageIds)
Definition: Typo3QuerySettings.php:156
‪TYPO3\CMS\Core\Context\LanguageAspect
Definition: LanguageAspect.php:55
‪TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
Definition: QuerySettingsInterface.php:21
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$storagePageIds
‪array $storagePageIds
Definition: Typo3QuerySettings.php:39
‪TYPO3\CMS\Extbase\Persistence\Generic
Definition: Backend.php:2
‪TYPO3\CMS\Extbase\Service\EnvironmentService
Definition: EnvironmentService.php:24
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getLanguageUid
‪int getLanguageUid()
Definition: Typo3QuerySettings.php:243
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\initializeObject
‪initializeObject()
Definition: Typo3QuerySettings.php:104
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$languageOverlayMode
‪mixed $languageOverlayMode
Definition: Typo3QuerySettings.php:72
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\getRespectSysLanguage
‪bool getRespectSysLanguage()
Definition: Typo3QuerySettings.php:185
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setEnableFieldsToBeIgnored
‪QuerySettingsInterface setEnableFieldsToBeIgnored($enableFieldsToBeIgnored)
Definition: Typo3QuerySettings.php:286
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setRespectStoragePage
‪QuerySettingsInterface setRespectStoragePage($respectStoragePage)
Definition: Typo3QuerySettings.php:134
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setIgnoreEnableFields
‪QuerySettingsInterface setIgnoreEnableFields($ignoreEnableFields)
Definition: Typo3QuerySettings.php:257
‪TYPO3\CMS\Extbase\Object\ObjectManager
Definition: ObjectManager.php:25
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setLanguageMode
‪QuerySettingsInterface setLanguageMode($languageMode='')
Definition: Typo3QuerySettings.php:214
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings
Definition: Typo3QuerySettings.php:28
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\setLanguageUid
‪QuerySettingsInterface setLanguageUid($languageUid)
Definition: Typo3QuerySettings.php:234
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings\$languageMode
‪string $languageMode
Definition: Typo3QuerySettings.php:80