Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getMessageParameters example
foreach
(
$errors
as
$error
)
{
if
(
!
$error
instanceof FormError
)
{
continue
;
}
$message
=
Shopware
(
)
->
Template
(
)
->
fetch
(
'string:' .
$error
->
getMessage
(
)
)
;
$origin
=
$error
->
getOrigin
(
)
;
$violations
[
]
=
new
ConstraintViolation
(
$message
,
$error
->
getMessageTemplate
(
)
,
$error
->
getMessageParameters
(
)
,
$origin
?
$origin
->
getRoot
(
)
: null,
$origin
?
(string)
$origin
->
getPropertyPath
(
)
: null,
$origin
?
$origin
->
getData
(
)
: null,
$error
->
getMessagePluralization
(
)
,
null,
null,
$error
->
getCause
(
)
)
;
}
return
new
self
(
new
ConstraintViolationList
(
$violations
)
)
;
}