context = clone $context; $this->configurationManager = $configurationManager; $this->languageAspect = $this->context->getAspect('language'); // see note in class' phpdoc about this condition if (($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface && ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend() ) { $this->setIgnoreEnableFields(true); } } /** * Sets the flag if the storage page should be respected for the query. * * @param bool $respectStoragePage If TRUE the storage page ID will be determined and the statement will be extended accordingly. */ public function setRespectStoragePage(bool $respectStoragePage): QuerySettingsInterface { $this->respectStoragePage = $respectStoragePage; return $this; } /** * Returns the state, if the storage page should be respected for the query. * * @return bool TRUE, if the storage page should be respected; otherwise FALSE. */ public function getRespectStoragePage(): bool { return $this->respectStoragePage; } /** * Sets the pid(s) of the storage page(s) that should be respected for the query. * * @param array $storagePageIds If given the storage page IDs will be determined and the statement will be extended accordingly. */ public function setStoragePageIds(array $storagePageIds): self { $this->storagePageIds = $storagePageIds; return $this; } /** * Returns the pid(s) of the storage page(s) that should be respected for the query. * * @return array list of integers that each represent a storage page id */ public function getStoragePageIds(): array { return $this->storagePageIds; } /** * @param bool $respectSysLanguage TRUE if TYPO3 language settings are to be applied */ public function setRespectSysLanguage(bool $respectSysLanguage): self { $this->respectSysLanguage = $respectSysLanguage; return $this; } /** * @return bool TRUE if TYPO3 language settings are to be applied */ public function getRespectSysLanguage(): bool { return $this->respectSysLanguage; } public function getLanguageAspect(): LanguageAspect { return $this->languageAspect; } public function setLanguageAspect(LanguageAspect $languageAspect): self { $this->languageAspect = $languageAspect; return $this; } /** * Sets a flag indicating whether all or some enable fields should be ignored. If TRUE, all enable fields are ignored. * If--in addition to this--enableFieldsToBeIgnored is set, only fields specified there are ignored. If FALSE, all * enable fields are taken into account, regardless of the enableFieldsToBeIgnored setting. * * @see setEnableFieldsToBeIgnored() */ public function setIgnoreEnableFields(bool $ignoreEnableFields): self { $this->ignoreEnableFields = $ignoreEnableFields; return $this; } /** * The returned value indicates whether all or some enable fields should be ignored. * * If TRUE, all enable fields are ignored. If--in addition to this--enableFieldsToBeIgnored is set, only fields specified there are ignored. * If FALSE, all enable fields are taken into account, regardless of the enableFieldsToBeIgnored setting. * * @see getEnableFieldsToBeIgnored() */ public function getIgnoreEnableFields(): bool { return $this->ignoreEnableFields; } /** * An array of column names in the enable columns array (array keys in $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']), * to be ignored while building the query statement. Adding a column name here effectively switches off filtering * by this column. This setting is only taken into account if $this->ignoreEnableFields = TRUE. * * @see setIgnoreEnableFields() */ public function setEnableFieldsToBeIgnored(array $enableFieldsToBeIgnored): self { $this->enableFieldsToBeIgnored = $enableFieldsToBeIgnored; return $this; } /** * An array of column names in the enable columns array (array keys in $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']), * to be ignored while building the query statement. * * @see getIgnoreEnableFields() */ public function getEnableFieldsToBeIgnored(): array { return $this->enableFieldsToBeIgnored; } /** * Sets the flag if the query should return objects that are deleted. */ public function setIncludeDeleted(bool $includeDeleted): self { $this->includeDeleted = $includeDeleted; return $this; } /** * Returns if the query should return objects that are deleted. */ public function getIncludeDeleted(): bool { return $this->includeDeleted; } }