Interface

eZ\Publish\SPI\FieldType\ValidationError

interface ValidationError implements Translatable

Interface for validation errors.

Enforces to return a translatable message, since it will be necessary to present validation errors to the user. Thus we need plural form handling and replacements of placeholders and so on.

Methods

Translation getTranslatableMessage()

Returns a translatable Message.

from Translatable
setTarget(string $target)

Sets the target element on which the error occurred.

string getTarget()

Returns the target element on which the error occurred.

Details

in Translatable at line 23
public Translation getTranslatableMessage()

Returns a translatable Message.

Return Value

Translation

at line 34
public setTarget(string $target)

Sets the target element on which the error occurred.

E.g. Property of a Field value which didn't validate against validation. Can be a property path compatible with Symfony PropertyAccess component.

Examples: - "[StringLengthValidator][minStringLength]" => Target is "minStringLength" key under "StringLengthValidator" key (fieldtype validator configuration) - "myfielddefinition_identifier"

Parameters

string $target

at line 41
public string getTarget()

Returns the target element on which the error occurred.

Return Value

string