$this->
validateField('firstname',
$address->
getFirstname(),
[new NotBlank()]);
$this->
validateField('lastname',
$address->
getLastname(),
[new NotBlank()]);
$this->
validateField('street',
$address->
getStreet(),
[new NotBlank()]);
$this->
validateField('zipcode',
$address->
getZipcode(),
[new NotBlank()]);
$this->
validateField('city',
$address->
getCity(),
[new NotBlank()]);
$this->
validateField('country',
$address->
getCountry() ?
$address->
getCountry() : null,
[new NotBlank()]);
$this->
validateField('phone',
$address->
getPhone(),
$this->
getPhoneConstraints());
$this->
validateField('additionalAddressLine1',
$address->
getAdditionalAddressLine1(),
$this->
getAdditionalAddressline1Constraints());
$this->
validateField('additionalAddressLine2',
$address->
getAdditionalAddressLine2(),
$this->
getAdditionalAddressline2Constraints());
if ($address->
getCountry() &&
$address->
getCountry()->
getForceStateInRegistration()) { $this->
validateField('state',
$address->
getState(),
[new NotBlank()]);
} if ($customerType === Customer::CUSTOMER_TYPE_BUSINESS
) { $this->
validateField('company',
$address->
getCompany(),
[new NotBlank()]);
if ($this->config->
offsetGet('vatcheckrequired'
)) { $this->
validateField('vatId',
$address->
getVatId(),
[new NotBlank()]);
} }