CreatableFormElementPropertiesValidator extends ElementBasedValidator
Table of Contents
Properties
- $currentElement : array<string|int, mixed>
- $sessionToken : string
- $validationDto : ValidationDto
Methods
- __construct() : mixed
- __invoke() : mixed
- Checks if the form element property is defined within the form editor setup or if the property is defined within the "predefinedDefaults" in the form editor setup and the property value matches the predefined value or if there is a valid hmac hash for the value.
- validateFormElementPropertyValueByHmacData() : void
- Throws an exception if value from a form element property does not match its hmac hash or if there is no hmac hash available for the value.
- buildHmacDataPath() : string
- Builds the path in which the hmac value is expected based on the property path.
- getConfigurationService() : ConfigurationService
- getFormDefinitionValidationService() : FormDefinitionValidationService
- validateFormElementPredefinedDefaultValue() : void
- Throws an exception if the value from a form element property does not match the default value from the form editor setup.
- validateFormElementValue() : void
- Throws an exception if the value from a form element property does not match the allowed set of values (defined within the form setup).
Properties
$currentElement
protected
array<string|int, mixed>
$currentElement
$sessionToken
protected
string
$sessionToken
$validationDto
protected
ValidationDto
$validationDto
Methods
__construct()
public
__construct(array<string|int, mixed> $currentElement, string $sessionToken, ValidationDto $validationDto) : mixed
Parameters
- $currentElement : array<string|int, mixed>
- $sessionToken : string
- $validationDto : ValidationDto
__invoke()
Checks if the form element property is defined within the form editor setup or if the property is defined within the "predefinedDefaults" in the form editor setup and the property value matches the predefined value or if there is a valid hmac hash for the value.
public
__invoke(string $key, mixed $value) : mixed
If the form element property is defined within the form editor setup and there is no valid hmac hash for the value and is the form element property configured to only allow a limited set of values, check the current (submitted) value against the allowed set of values (defined within the form setup).
Parameters
- $key : string
- $value : mixed
validateFormElementPropertyValueByHmacData()
Throws an exception if value from a form element property does not match its hmac hash or if there is no hmac hash available for the value.
public
validateFormElementPropertyValueByHmacData(array<string|int, mixed> $currentElement, mixed $value, string $sessionToken, ValidationDto $dto) : void
Parameters
- $currentElement : array<string|int, mixed>
- $value : mixed
- $sessionToken : string
- $dto : ValidationDto
Tags
buildHmacDataPath()
Builds the path in which the hmac value is expected based on the property path.
protected
buildHmacDataPath(string $propertyPath) : string
Parameters
- $propertyPath : string
Return values
stringgetConfigurationService()
protected
getConfigurationService() : ConfigurationService
Return values
ConfigurationServicegetFormDefinitionValidationService()
protected
getFormDefinitionValidationService() : FormDefinitionValidationService
Return values
FormDefinitionValidationServicevalidateFormElementPredefinedDefaultValue()
Throws an exception if the value from a form element property does not match the default value from the form editor setup.
protected
validateFormElementPredefinedDefaultValue(mixed $value, ValidationDto $dto) : void
Parameters
- $value : mixed
- $dto : ValidationDto
Tags
validateFormElementValue()
Throws an exception if the value from a form element property does not match the allowed set of values (defined within the form setup).
protected
validateFormElementValue(mixed $value, ValidationDto $dto) : void
Parameters
- $value : mixed
- $dto : ValidationDto