Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getCheckPostalCodePattern example
if
(
$country
->
getPostalCodeRequired
(
)
)
{
if
(
$value
=== null ||
$value
=== ''
)
{
$this
->context->
buildViolation
(
$constraint
->
getMessageRequired
(
)
)
->
setCode
(
NotBlank::IS_BLANK_ERROR
)
->
addViolation
(
)
;
return
;
}
}
if
(
!
$country
->
getCheckPostalCodePattern
(
)
&& !
$country
->
getCheckAdvancedPostalCodePattern
(
)
)
{
return
;
}
$pattern
=
$country
->
getDefaultPostalCodePattern
(
)
;
if
(
$country
->
getCheckAdvancedPostalCodePattern
(
)
)
{
$pattern
=
$country
->
getAdvancedPostalCodePattern
(
)
;
}
if
(
$pattern
=== null
)
{
return
;
}