Class CustomerInputValidator

Class CustomerInputValidator

Validator class that checks the entered user data.

CustomerInputValidator implements CustomerInputValidatorInterface uses XtcUtilityTrait
Package: Customer\Validation
Category: System
Implements: CustomerInputValidatorInterface
Located at Services/Core/Customer/CustomerInputValidator.inc.php

Methods summary

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

Constructor of the class CustomerInputValidator.

public validateGender( string $p_gender ) : boolean

Checks if the entered customer's gender is valid.

public validateFirstname( string $p_firstname ) : boolean

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

public validateLastname( string $p_lastname ) : boolean

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

public validateDateOfBirth( string $p_dateOfBirth ) : boolean

Checks if the entered customer's date of birth is valid. Valid format is: dd.mm.yyyy

public validateCompany( string $p_company ) : boolean

Checks if the entered customer's company is valid.

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

Checks if the entered parameters are in a valid format.

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

Checks if the entered email and email confirmation are valid. It will check the minimum length, address syntax, confirmation matching and existence of e-mail address.

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

Checks if the entered email is valid.

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

Checks if the entered email already exists.

public validateStreet( string $p_street ) : boolean

Checks if the entered street is valid.

public validateHouseNumber( string $p_house_number ) : boolean

Checks if the entered house number is valid.

public validatePostcode( string $p_postcode ) : boolean

Checks if the entered postcode is valid.

public validateCity( string $p_city ) : boolean

Checks if the entered city is valid.

public validateCountry( integer $p_countryId ) : boolean

Checks if the entered country exists.

public validateCountryZone( $p_countryZone, $p_countryId ) : boolean

Checks if the entered country zone is valid.

public validateSuburb( $p_suburb ) : boolean

Checks if the entered suburb is valid.

public validateTelephoneNumber( string $p_telephoneNumber ) : boolean

Checks if the entered telephone number is valid.

public validateFaxNumber( string $p_faxNumber ) : boolean

Checks if the entered fax number is valid.

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

Checks if the entered password is valid.

public validatePrivacy( string $p_privacyAccepted ) : boolean

Checks if the user has accepted the privacy policy.

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

Checks if the captcha input is valid.

public validateAddonValues( KeyValueCollection $addonValues ) : boolean

Checks if the entered additional values are valid.

public getErrorMessages( void ) : array

Returns error messages.

public getErrorMessageCollection( void ) : EditableKeyValueCollection

Returns a collection of error messages.

public getErrorStatus( void ) : boolean

Returns the error status.

Methods used from XtcUtilityTrait

xtcDateRaw(), xtcValidateEmail()

Properties summary

protected $customerCountryRepository : CustomerCountryRepositoryInterface

Customer country repository.


		
protected $customerCountryZoneRepository : CustomerCountryZoneRepositoryInterface

Customer country zone repository.


		
protected $customerService : CustomerServiceInterface

Customer service.


		
protected $countryService : CountryServiceInterface

Country service.


		
protected $settings : CustomerInputValidatorSettingsInterface

Customer input validator settings.


		
protected $vatNumberValidator : VatNumberValidatorInterface

VAT number validator.


		
protected $errorMessageCollection : EditableKeyValueCollection

Error message collection.


		
protected $errorStatus : boolean

Error status.

false