ViolationMapper
in package
implements
ViolationMapperInterface
Tags
Table of Contents
Interfaces
Properties
- $allowNonSynchronized : bool
- $formRenderer : mixed
- $translator : mixed
Methods
- __construct() : mixed
- mapViolation() : mixed
- Maps a constraint violation to a form in the form tree under the given form.
- acceptsErrors() : bool
- matchChild() : FormInterface|null
- Tries to match the beginning of the property path at the current position against the children of the scope.
- reconstructPath() : RelativePath|null
- Reconstructs a property path from a violation path and a form tree.
Properties
$allowNonSynchronized
private
bool
$allowNonSynchronized
= false
$formRenderer
private
mixed
$formRenderer
$translator
private
mixed
$translator
Methods
__construct()
public
__construct([FormRendererInterface $formRenderer = null ][, TranslatorInterface $translator = null ]) : mixed
Parameters
- $formRenderer : FormRendererInterface = null
- $translator : TranslatorInterface = null
mapViolation()
Maps a constraint violation to a form in the form tree under the given form.
public
mapViolation(ConstraintViolation $violation, FormInterface $form[, bool $allowNonSynchronized = false ]) : mixed
Parameters
- $violation : ConstraintViolation
- $form : FormInterface
- $allowNonSynchronized : bool = false
-
Whether to allow mapping to non-synchronized forms
acceptsErrors()
private
acceptsErrors(FormInterface $form) : bool
Parameters
- $form : FormInterface
Return values
boolmatchChild()
Tries to match the beginning of the property path at the current position against the children of the scope.
private
matchChild(FormInterface $form, PropertyPathIteratorInterface $it) : FormInterface|null
If a matching child is found, it is returned. Otherwise null is returned.
Parameters
- $form : FormInterface
- $it : PropertyPathIteratorInterface
Return values
FormInterface|nullreconstructPath()
Reconstructs a property path from a violation path and a form tree.
private
reconstructPath(ViolationPath $violationPath, FormInterface $origin) : RelativePath|null
Parameters
- $violationPath : ViolationPath
- $origin : FormInterface