Copied!

ConstraintViolationAdapter

ConstraintViolationAdapter.php : 20
Implements ValidationError

{@see \Symfony\Component\Validator\ConstraintViolationInterface} to {@see \Ibexa\Contracts\Core\FieldType\ValidationError} adapter.

Methods

public__construct()

ConstraintViolationAdapter.php : 35
public __construct(ConstraintViolationInterface $violation)

Parameters

Name Type Default value Description
$violation ConstraintViolationInterface - -

publicgetTarget()

ConstraintViolationAdapter.php : 54

Returns the target element on which the error occurred.

public getTarget() : string

Return values

string

publicgetTranslatableMessage()

ConstraintViolationAdapter.php : 41

Returns a translatable Message.

public getTranslatableMessage() : Translation

Return values

Translation

publicsetTarget()

ConstraintViolationAdapter.php : 49

Sets the target element on which the error occurred.

public setTarget(mixed $target) : void

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

Name Type Default value Description
$target mixed - -