Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | List of all members
eZ\Publish\SPI\FieldType\ValidationError Interface Reference

Interface for validation errors. More...

Inheritance diagram for eZ\Publish\SPI\FieldType\ValidationError:

## Public Member Functions
| setTarget ($target)
| Sets the target element on which the error occurred. More...
| getTarget ()
| Returns the target element on which the error occurred. More...
Public Member Functions inherited from eZ\Publish\API\Repository\Translatable
| getTranslatableMessage ()
| Returns a translatable Message. More...

## Detailed Description

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.

Definition at line 18 of file SPI/FieldType/ValidationError.php.

## Member Function Documentation

## ◆ getTarget()

eZ\Publish\SPI\FieldType\ValidationError::getTarget | ( |  | ) |

Returns the target element on which the error occurred.

Returns
  string

Implemented in eZ\Publish\Core\FieldType\ValidationError.

## ◆ setTarget()

eZ\Publish\SPI\FieldType\ValidationError::setTarget | ( |  | $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)
- "my_field_definition_identifier"

Parameters

  string | $target |

Implemented in eZ\Publish\Core\FieldType\ValidationError.

The documentation for this interface was generated from the following file:

- SPI/FieldType/ValidationError.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.