ConfigurationService implements SingletonInterface

Helper for configuration settings Scope: frontend / backend

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Properties

$firstLevelCache  : array<string|int, mixed>
$formSettings  : array<string|int, mixed>
$translationService  : TranslationService

Methods

__construct()  : mixed
formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup()  : bool
If a form element editor has a property called "selectOptions" (e.g. editors with templateName "Inspector-SingleSelectEditor" or "Inspector-MultiSelectEditor") then only the defined values within the selectOptions are allowed to be written by the form editor.
getAllBackendTranslationsForTranslationKey()  : array<string|int, mixed>
getAllBackendTranslationsForTranslationKeys()  : array<string|int, mixed>
getAllowedValuesForFormElementPropertyFromFormEditorSetup()  : array<string|int, mixed>
Get the "selectOptions" value for a form element property from the form setup.
getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetup()  : array<string|int, mixed>
Get the "selectOptions" value for a form elements finisher|validator property from the form setup.
getFormElementPredefinedDefaultValueFromFormEditorSetup()  : mixed
Get the "predefinedDefaults" value for a form element property from the form setup.
getPropertyCollectionPredefinedDefaultValueFromFormEditorSetup()  : mixed
Get the "predefinedDefaults" value for a form elements finisher|validator property from the form setup.
getPrototypeConfiguration()  : array<string|int, mixed>
Get the prototype configuration
getSelectablePrototypeNamesDefinedInFormEditorSetup()  : array<string|int, mixed>
Return all prototype names which are defined within "formManager.selectablePrototypesConfiguration.*.identifier"
isFormElementPropertyDefinedInFormEditorSetup()  : bool
Check if a form element property is defined in the form setup.
isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetup()  : bool
Check if a form element property is defined in "predefinedDefaults" in the form setup.
isFormElementTypeCreatableByFormEditor()  : bool
Check if the form element is creatable through the form editor.
isFormElementTypeDefinedInFormSetup()  : bool
Check if the form elements type is defined within the form setup.
isPropertyCollectionElementIdentifierCreatableByFormEditor()  : bool
Check if the form elements finisher|validator is creatable through the form editor.
isPropertyCollectionPropertyDefinedInFormEditorSetup()  : bool
Check if a form elements finisher|validator property is defined in the form setup.
isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup()  : bool
Check if a form elements finisher|validator property is defined in "predefinedDefaults" in the form setup.
propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup()  : bool
If a form elements finisher|validator editor has a property called "selectOptions" (e.g. editors with templateName "Inspector-SingleSelectEditor" or "Inspector-MultiSelectEditor") then only the defined values within the selectOptions are allowed to be written by the form editor.
addAdditionalPropertyPathsFromHook()  : array<string|int, mixed>
buildFormDefinitionValidationConfigurationFromFormEditorSetup()  : array<string|int, mixed>
Collect all the form editor configurations which are needed to check if a form definition property can be written or not.
executeBuildFormDefinitionValidationConfigurationHooks()  : array<string|int, mixed>
If you use a custom form editor "inspector editor" implementation which does not define the writable property paths by one of the described inspector editor properties (e.g "propertyPath") within the form setup, you must provide the writable property paths with a hook.
getBasePropertyPathFromMultiValueFormElementProperty()  : string
getBasePropertyPathFromMultiValuePropertyCollectionElement()  : string
getCacheEntry()  : mixed
getCacheFrontend()  : FrontendInterface
getTranslationService()  : TranslationService
isPropertyDefinedInFormEditorSetup()  : bool
setCacheEntry()  : void
translatePredefinedDefaults()  : array<string|int, mixed>
translateSelectOptions()  : array<string|int, mixed>
translateValues()  : array<string|int, mixed>

Properties

$firstLevelCache

protected array<string|int, mixed> $firstLevelCache = []

$formSettings

protected array<string|int, mixed> $formSettings

Methods

formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup()

If a form element editor has a property called "selectOptions" (e.g. editors with templateName "Inspector-SingleSelectEditor" or "Inspector-MultiSelectEditor") then only the defined values within the selectOptions are allowed to be written by the form editor.

public formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup(ValidationDto $dto) : bool
Parameters
$dto : ValidationDto
Internal
Return values
bool

getAllBackendTranslationsForTranslationKey()

public getAllBackendTranslationsForTranslationKey(string $key, string $prototypeName) : array<string|int, mixed>
Parameters
$key : string
$prototypeName : string
Return values
array<string|int, mixed>

getAllBackendTranslationsForTranslationKeys()

public getAllBackendTranslationsForTranslationKeys(array<string|int, mixed> $keys, string $prototypeName) : array<string|int, mixed>
Parameters
$keys : array<string|int, mixed>
$prototypeName : string
Internal
Return values
array<string|int, mixed>

getAllowedValuesForFormElementPropertyFromFormEditorSetup()

Get the "selectOptions" value for a form element property from the form setup.

public getAllowedValuesForFormElementPropertyFromFormEditorSetup(ValidationDto $dto[, bool $translated = true ]) : array<string|int, mixed>
Parameters
$dto : ValidationDto
$translated : bool = true
Internal
Tags
throws
PropertyException
Return values
array<string|int, mixed>

getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetup()

Get the "selectOptions" value for a form elements finisher|validator property from the form setup.

public getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetup(ValidationDto $dto[, bool $translated = true ]) : array<string|int, mixed>
Parameters
$dto : ValidationDto
$translated : bool = true
Internal
Tags
throws
PropertyException
Return values
array<string|int, mixed>

getFormElementPredefinedDefaultValueFromFormEditorSetup()

Get the "predefinedDefaults" value for a form element property from the form setup.

public getFormElementPredefinedDefaultValueFromFormEditorSetup(ValidationDto $dto[, bool $translated = true ]) : mixed

A form element default property is defined within the following form editor properties:

  • formElementsDefinition.<formElementType>.formEditor.predefinedDefaults.<propertyPath> = "default value"
Parameters
$dto : ValidationDto
$translated : bool = true
Internal
Tags
throws
PropertyException

getPropertyCollectionPredefinedDefaultValueFromFormEditorSetup()

Get the "predefinedDefaults" value for a form elements finisher|validator property from the form setup.

public getPropertyCollectionPredefinedDefaultValueFromFormEditorSetup(ValidationDto $dto[, bool $translated = true ]) : mixed

A form elements finisher|validator default property is defined within the following form editor properties:

  • <validatorsDefinition|finishersDefinition>..formEditor.predefinedDefaults.<propertyPath> = "default value"
Parameters
$dto : ValidationDto
$translated : bool = true
Internal
Tags
throws
PropertyException

getPrototypeConfiguration()

Get the prototype configuration

public getPrototypeConfiguration(string $prototypeName) : array<string|int, mixed>
Parameters
$prototypeName : string

name of the prototype to get the configuration for

Tags
throws
PrototypeNotFoundException

if prototype with the name $prototypeName was not found

Return values
array<string|int, mixed>

the prototype configuration

getSelectablePrototypeNamesDefinedInFormEditorSetup()

Return all prototype names which are defined within "formManager.selectablePrototypesConfiguration.*.identifier"

public getSelectablePrototypeNamesDefinedInFormEditorSetup() : array<string|int, mixed>
Internal
Return values
array<string|int, mixed>

isFormElementPropertyDefinedInFormEditorSetup()

Check if a form element property is defined in the form setup.

public isFormElementPropertyDefinedInFormEditorSetup(ValidationDto $dto) : bool

If a form element property is defined in the form setup then it means that the form element property can be written by the form editor. A form element property can be written if the property path is defined within the following form editor properties:

  • formElementsDefinition.<formElementType>.formEditor.editors..propertyPath
  • formElementsDefinition.<formElementType>.formEditor.editors..*.propertyPath
  • formElementsDefinition.<formElementType>.formEditor.editors..additionalElementPropertyPaths
  • formElementsDefinition.<formElementType>.formEditor.propertyCollections.<finishers|validators>..editors..additionalElementPropertyPaths If a form editor property "templateName" is "Inspector-PropertyGridEditor" or "Inspector-MultiSelectEditor" or "Inspector-ValidationErrorMessageEditor" it means that the form editor property "propertyPath" is interpreted as a so called "multiValueProperty". A "multiValueProperty" can contain any subproperties relative to the value from "propertyPath" which are valid. If "formElementsDefinition.<formElementType>.formEditor.editors..templateName = Inspector-PropertyGridEditor" and "formElementsDefinition.<formElementType>.formEditor.editors..propertyPath = options.xxx" then (for example) "options.xxx.yyy" is a valid property path to write. If you use a custom form editor "inspector editor" implementation which does not define the writable property paths by one of the above described inspector editor properties (e.g "propertyPath") within the form setup, you must provide the writable property paths with a hook.
Parameters
$dto : ValidationDto
Internal
Tags
see
executeBuildFormDefinitionValidationConfigurationHooks()
Return values
bool

isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetup()

Check if a form element property is defined in "predefinedDefaults" in the form setup.

public isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetup(ValidationDto $dto) : bool

If a form element property is defined in the "predefinedDefaults" in the form setup then it means that the form element property can be written by the form editor. A form element default property is defined within the following form editor properties:

  • formElementsDefinition.<formElementType>.formEditor.predefinedDefaults.<propertyPath> = "default value"
Parameters
$dto : ValidationDto
Internal
Return values
bool

isFormElementTypeCreatableByFormEditor()

Check if the form element is creatable through the form editor.

public isFormElementTypeCreatableByFormEditor(ValidationDto $dto) : bool

A form element is creatable if the following properties are set:

  • formElementsDefinition.<formElementType>.formEditor.group
  • formElementsDefinition.<formElementType>.formEditor.groupSorting And the value from "formElementsDefinition.<formElementType>.formEditor.group" is one of the keys within "formEditor.formElementGroups"
Parameters
$dto : ValidationDto
Internal
Return values
bool

isFormElementTypeDefinedInFormSetup()

Check if the form elements type is defined within the form setup.

public isFormElementTypeDefinedInFormSetup(ValidationDto $dto) : bool
Parameters
$dto : ValidationDto
Internal
Return values
bool

isPropertyCollectionElementIdentifierCreatableByFormEditor()

Check if the form elements finisher|validator is creatable through the form editor.

public isPropertyCollectionElementIdentifierCreatableByFormEditor(ValidationDto $dto) : bool

A form elements finisher|validator is creatable if the following conditions are true: "formElementsDefinition.<formElementType>.formEditor.editors..templateName = Inspector-FinishersEditor" or "formElementsDefinition.<formElementType>.formEditor.editors..templateName = Inspector-ValidatorsEditor" and "formElementsDefinition.<formElementType>.formEditor.editors..selectOptions..value = <finisherIdentifier|validatorIdentifier>"

Parameters
$dto : ValidationDto
Internal
Return values
bool

isPropertyCollectionPropertyDefinedInFormEditorSetup()

Check if a form elements finisher|validator property is defined in the form setup.

public isPropertyCollectionPropertyDefinedInFormEditorSetup(ValidationDto $dto) : bool

If a form elements finisher|validator property is defined in the form setup then it means that the form elements finisher|validator property can be written by the form editor. A form elements finisher|validator property can be written if the property path is defined within the following form editor properties:

  • formElementsDefinition.<formElementType>.formEditor.propertyCollections.<finishers|validators>..editors..propertyPath
  • formElementsDefinition.<formElementType>.formEditor.propertyCollections.<finishers|validators>..editors..*.propertyPath If a form elements finisher|validator property "templateName" is "Inspector-PropertyGridEditor" or "Inspector-MultiSelectEditor" or "Inspector-ValidationErrorMessageEditor" it means that the form editor property "propertyPath" is interpreted as a so called "multiValueProperty". A "multiValueProperty" can contain any subproperties relative to the value from "propertyPath" which are valid. If "formElementsDefinition.<formElementType>.formEditor.propertyCollections.<finishers|validators>..editors..templateName = Inspector-PropertyGridEditor" and "formElementsDefinition.<formElementType>.formEditor.propertyCollections.<finishers|validators>..editors..propertyPath = options.xxx" that (for example) "options.xxx.yyy" is a valid property path to write. If you use a custom form editor "inspector editor" implementation which not defines the writable property paths by one of the above described inspector editor properties (e.g "propertyPath") within the form setup, you must provide the writable property paths with a hook.
Parameters
$dto : ValidationDto
Internal
Tags
see
executeBuildFormDefinitionValidationConfigurationHooks()
Return values
bool

isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup()

Check if a form elements finisher|validator property is defined in "predefinedDefaults" in the form setup.

public isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup(ValidationDto $dto) : bool

If a form elements finisher|validator property is defined in "predefinedDefaults" in the form setup then it means that the form elements finisher|validator property can be written by the form editor. A form elements finisher|validator default property is defined within the following form editor properties:

  • <validatorsDefinition|finishersDefinition>..formEditor.predefinedDefaults.<propertyPath> = "default value"
Parameters
$dto : ValidationDto
Internal
Return values
bool

propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup()

If a form elements finisher|validator editor has a property called "selectOptions" (e.g. editors with templateName "Inspector-SingleSelectEditor" or "Inspector-MultiSelectEditor") then only the defined values within the selectOptions are allowed to be written by the form editor.

public propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup(ValidationDto $dto) : bool
Parameters
$dto : ValidationDto
Internal
Return values
bool

addAdditionalPropertyPathsFromHook()

protected addAdditionalPropertyPathsFromHook(string $hookClassName, string $prototypeName, array<string|int, mixed> $propertyPathsFromHook, array<string|int, mixed> $configuration) : array<string|int, mixed>
Parameters
$hookClassName : string
$prototypeName : string
$propertyPathsFromHook : array<string|int, mixed>
$configuration : array<string|int, mixed>
Tags
throws
PropertyException
Return values
array<string|int, mixed>

buildFormDefinitionValidationConfigurationFromFormEditorSetup()

Collect all the form editor configurations which are needed to check if a form definition property can be written or not.

protected buildFormDefinitionValidationConfigurationFromFormEditorSetup(string $prototypeName) : array<string|int, mixed>
Parameters
$prototypeName : string
Return values
array<string|int, mixed>

executeBuildFormDefinitionValidationConfigurationHooks()

If you use a custom form editor "inspector editor" implementation which does not define the writable property paths by one of the described inspector editor properties (e.g "propertyPath") within the form setup, you must provide the writable property paths with a hook.

protected executeBuildFormDefinitionValidationConfigurationHooks(string $prototypeName, array<string|int, mixed> $configuration) : array<string|int, mixed>
Parameters
$prototypeName : string
$configuration : array<string|int, mixed>
Tags
see
isFormElementPropertyDefinedInFormEditorSetup()
see
isPropertyCollectionPropertyDefinedInFormEditorSetup()

Connect to the hook: $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['buildFormDefinitionValidationConfiguration'][] = \Vendor\YourNamespace\YourClass::class; Use the hook: public function addAdditionalPropertyPaths(\TYPO3\CMS\Form\Domain\Configuration\FormDefinition\Validators\ValidationDto $validationDto): array { $textValidationDto = $validationDto->withFormElementType('Text'); $textValidatorsValidationDto = $textValidationDto->withPropertyCollectionName('validators'); $dateValidationDto = $validationDto->withFormElementType('Date'); $propertyPaths = [ $textValidationDto->withPropertyPath('properties.my.custom.property'), $textValidationDto->withPropertyPath('properties.my.other.custom.property'), $textValidatorsValidationDto->withPropertyCollectionElementIdentifier('StringLength')->withPropertyPath('options.custom.property'), $textValidatorsValidationDto->withPropertyCollectionElementIdentifier('CustomValidator')->withPropertyPath('options.other.custom.property'), $dateValidationDto->withPropertyPath('properties.custom.property'), // .. ]; return $propertyPaths; }

throws
PropertyException
Return values
array<string|int, mixed>

getBasePropertyPathFromMultiValueFormElementProperty()

protected getBasePropertyPathFromMultiValueFormElementProperty(ValidationDto $dto) : string
Parameters
$dto : ValidationDto
Return values
string

getBasePropertyPathFromMultiValuePropertyCollectionElement()

protected getBasePropertyPathFromMultiValuePropertyCollectionElement(ValidationDto $dto) : string
Parameters
$dto : ValidationDto
Return values
string

getCacheEntry()

protected getCacheEntry(string $cacheKey) : mixed
Parameters
$cacheKey : string

isPropertyDefinedInFormEditorSetup()

protected isPropertyDefinedInFormEditorSetup(string $propertyPath, array<string|int, mixed> $subConfig) : bool
Parameters
$propertyPath : string
$subConfig : array<string|int, mixed>
Return values
bool

setCacheEntry()

protected setCacheEntry(string $cacheKey, mixed $value) : void
Parameters
$cacheKey : string
$value : mixed

translatePredefinedDefaults()

protected translatePredefinedDefaults(array<string|int, mixed> $prototypeConfiguration, array<string|int, mixed> $formElements) : array<string|int, mixed>
Parameters
$prototypeConfiguration : array<string|int, mixed>
$formElements : array<string|int, mixed>
Return values
array<string|int, mixed>

translateSelectOptions()

protected translateSelectOptions(array<string|int, mixed> $prototypeConfiguration, array<string|int, mixed> $formElements) : array<string|int, mixed>
Parameters
$prototypeConfiguration : array<string|int, mixed>
$formElements : array<string|int, mixed>
Return values
array<string|int, mixed>

translateValues()

protected translateValues(array<string|int, mixed> $prototypeConfiguration, array<string|int, mixed> $configuration) : array<string|int, mixed>
Parameters
$prototypeConfiguration : array<string|int, mixed>
$configuration : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results