CustomerRegistrationInputValidatorService

Extends \CustomerInputValidator Implements \CustomerRegistrationInputValidatorServiceInterface

Class CustomerRegistrationInputValidatorService

This class is used for validating customer input while registration

category

System

package

Customer

subpackage

Validation

extends

CustomerInputValidator

implements

CustomerRegistrationInputValidatorServiceInterface

Methods

Constructor of the class CustomerInputValidator.

__construct(\CustomerServiceInterface $customerService, \CountryServiceInterface $countryService, \CustomerInputValidatorSettingsInterface $customerInputValidatorSettings, \CustomerCountryRepositoryInterface $customerCountryRepository, \CustomerCountryZoneRepositoryInterface $customerCountryZoneRepository, \VatNumberValidatorInterface $vatNumberValidator) 
inherited

Arguments

$customerService

\CustomerServiceInterface

Customer service.

$countryService

\CountryServiceInterface

Country service.

$customerInputValidatorSettings

\CustomerInputValidatorSettingsInterface

Customer input validator settings.

$customerCountryRepository

\CustomerCountryRepositoryInterface

Customer country repository.

$customerCountryZoneRepository

\CustomerCountryZoneRepositoryInterface

Customer country zone repository.

$vatNumberValidator

\VatNumberValidatorInterface

VAT number validator.

_namesOptionalAndCompanyNotEmpty

_namesOptionalAndCompanyNotEmpty(array $inputArray) 

Arguments

$inputArray

array

Checks if the entered data is valid.

_validateDataByArray(array $inputArray) : boolean

Expects an array with the following keys:

  • gender
  • firstname
  • lastname
  • dob (date of birth)
  • company
  • email_address
  • suburb
  • email_address_confirm
  • postcode
  • city
  • country
  • state (ID or name)
  • telephone
  • fax
  • vat
  • privacy_accepted

Arguments

$inputArray

array

Customer Input array.

Response

boolean

Is customer data valid?

Returns a collection of error messages.

getErrorMessageCollection() : \EditableKeyValueCollection
inherited

Response

\EditableKeyValueCollection

Collection of error messages.

Returns error messages.

getErrorMessages() : array
inherited
deprecated

Use getErrorMessageCollection() instead

Response

array

Error messages.

Returns the error status.

getErrorStatus() : boolean
inherited

Response

boolean

Error status.

Checks if the entered additional values are valid.

validateAddonValues(\KeyValueCollection $addonValues) : boolean
inherited

Overload this method to implement needed validation logic.

Arguments

$addonValues

\KeyValueCollection

Customer's additional values.

Response

boolean

Is valid?

Checks if the captcha input is valid.

validateCaptcha(array $p_customerInput, string $p_section = 'vvCode') : boolean
inherited

Arguments

$p_customerInput

array

Input Customer form input.

$p_section

string

Captcha section.

Response

boolean

is captcha valid?

Checks if the entered city is valid.

validateCity(string $p_city) : boolean
inherited

Arguments

$p_city

string

Customer's city.

Response

boolean

Is valid?

Checks if the entered customer's company is valid.

validateCompany(string $p_company) : boolean
inherited

Arguments

$p_company

string

Customer's company.

Response

boolean

Is valid?

Checks if the entered country exists.

validateCountry(integer $p_countryId) : boolean
inherited

Arguments

$p_countryId

integer

Customer's country ID.

Response

boolean

Is valid?

Checks if the entered country zone is valid.

validateCountryZone( $p_countryZone,  $p_countryId) : boolean
inherited

Cases:

  • If country has zones: It checks if zone belongs to country.
  • If country does not contain zones: It checks the minimum length of zone name.

Arguments

$p_countryZone

Customer's country zone name.

$p_countryId

Customer's country ID.

Response

boolean

Is valid?

Validates the entered customer data with an array of parameters.

validateCustomerDataByArray(array $inputArray) : boolean

Expects array with following keys:

  • gender
  • firstname
  • lastname
  • dob (date of birth)
  • company
  • email_address
  • email_address_confirm
  • postcode
  • city
  • country
  • state (ID or name)
  • telephone
  • vat
  • password
  • confirmation
  • privacy_accepted

Arguments

$inputArray

array

Customer data input.

Response

boolean

Is customer data valid?

Checks if the entered customer's date of birth is valid.

validateDateOfBirth(string $p_dateOfBirth) : boolean
inherited

Valid format is: dd.mm.yyyy

Arguments

$p_dateOfBirth

string

Customer's date of birth.

Response

boolean

Is valid?

Checks if the entered email is valid.

validateEmail(string $p_email, mixed $p_emailAddressCheck = false) : boolean
inherited

Arguments

$p_email

string

Customer's E-Mail address.

$p_emailAddressCheck

mixed

C

Response

boolean

Is valid?

Checks if the entered email and email confirmation are valid.

validateEmailAndConfirmation(string $p_email, string $p_emailConfirmation) : boolean
inherited

It will check the minimum length, address syntax, confirmation matching and existence of e-mail address.

Arguments

$p_email

string

Customer's E-Mail address.

$p_emailConfirmation

string

Confirmation E-Mail address.

Response

boolean

Is valid?

Checks if the entered email already exists.

validateEmailExists(string $p_email, \CustomerInterface $customer = null) : boolean
inherited

Arguments

$p_email

string

Customer's E-Mail address-

$customer

\CustomerInterface

Customer.

Response

boolean

Is valid?

Checks if the entered fax number is valid.

validateFaxNumber(string $p_faxNumber) : boolean
inherited

Arguments

$p_faxNumber

string

Customer's fax number.

Response

boolean

Is valid?

Checks if the entered customer's first name is valid.

validateFirstname(string $p_firstname) : boolean
inherited

Arguments

$p_firstname

string

Customer's first name.

Response

boolean

Is valid?

Checks if the entered customer's gender is valid.

validateGender(string $p_gender) : boolean
inherited

Arguments

$p_gender

string

Customer's gender.

Response

boolean

Is valid?

Validate the entered guest data with an array of parameters.

validateGuestDataByArray(array $inputArray) : boolean

expects array with following keys:

  • gender
  • firstname
  • lastname
  • dob (date of birth)
  • company
  • email_address
  • email_address_confirm
  • postcode
  • city
  • country
  • state (ID or name)
  • telephone
  • vat
  • privacy_accepted

Arguments

$inputArray

array

Guest customer data input.

Response

boolean

Is guest customer data valid?

Checks if the entered house number is valid.

validateHouseNumber(string $p_house_number) : boolean
inherited

Arguments

$p_house_number

string

Customer's house number.

Response

boolean

Is valid?

Checks if the entered customer's last name is valid.

validateLastname(string $p_lastname) : boolean
inherited

Arguments

$p_lastname

string

Customer's last name.

Response

boolean

Is valid?

Checks if the entered password is valid.

validatePassword(string $p_password, string $p_passwordConfirmation) : boolean
inherited

Arguments

$p_password

string

Customer's password.

$p_passwordConfirmation

string

Customer's password confirmation.

Response

boolean

Is valid?

Checks if the entered postcode is valid.

validatePostcode(string $p_postcode) : boolean
inherited

Arguments

$p_postcode

string

Customer's post code.

Response

boolean

Is valid?

Checks if the user has accepted the privacy policy.

validatePrivacy(string $p_privacyAccepted) : boolean
inherited

Arguments

$p_privacyAccepted

string

Response

boolean

Is valid?

Checks if the entered street is valid.

validateStreet(string $p_street) : boolean
inherited

Arguments

$p_street

string

Customer's street.

Response

boolean

Is valid?

Checks if the entered suburb is valid.

validateSuburb( $p_suburb) : boolean
inherited

Arguments

$p_suburb

Customer's suburb.

Response

boolean

Is valid?

Checks if the entered telephone number is valid.

validateTelephoneNumber(string $p_telephoneNumber) : boolean
inherited

Arguments

$p_telephoneNumber

string

Customer's telephone number.

Response

boolean

Is valid?

Checks if the entered parameters are in a valid format.

validateVatNumber(string $p_vatNumber, integer $p_countryId, boolean $p_isGuest) : boolean
inherited

Arguments

$p_vatNumber

string

VAT number.

$p_countryId

integer

Country ID.

$p_isGuest

boolean

Is customer a guest?

Response

boolean

Is valid?

IMPORTANT NOTE: The algorithm and PHPDoc block is copied from the xtc_date_raw() function.

xtcDateRaw(string $date, boolean $reverse = false) : string
inherited

The function file can be found here: src/inc/xtc_date_raw.inc.php

Return date in raw format.

Provided $p_date parameter should be in DD.MM.YYYY or MM.DD.YYYY format depending the current language. The result (raw date) will be formatted in YYYYMMDD. If the provided $p_date parameter is invalid the result will be an empty string.

Arguments

$date

string

$reverse

boolean

(optional)

Response

string

xtcValidateEmail

xtcValidateEmail( $email,  $emailAddressCheck) 
inherited

Arguments

$email

$emailAddressCheck

Properties

Customer country repository.

customerCountryRepository : \CustomerCountryRepositoryInterface
inherited

Customer country zone repository.

customerCountryZoneRepository : \CustomerCountryZoneRepositoryInterface
inherited

Customer service.

customerService : \CustomerServiceInterface
inherited

Country service.

countryService : \CountryServiceInterface
inherited

Customer input validator settings.

settings : \CustomerInputValidatorSettingsInterface
inherited

VAT number validator.

vatNumberValidator : \VatNumberValidatorInterface
inherited

Error message collection.

errorMessageCollection : \EditableKeyValueCollection
inherited

Error status.

errorStatus : boolean
inherited
var

Type(s)

boolean