OXID eShop CE  6.4.2
OxidEsales\EshopCommunity\Core\InputValidator Class Reference
+ Inheritance diagram for OxidEsales\EshopCommunity\Core\InputValidator:
+ Collaboration diagram for OxidEsales\EshopCommunity\Core\InputValidator:

Public Member Functions

 __construct ()
 
 validateBasketAmount ($amount)
 
 checkLogin ($user, $login, $invAddress)
 
 checkEmail ($user, $email)
 
 checkPassword ($user, $newPassword, $confirmationPassword, $shouldCheckPasswordLength=false)
 
 getPasswordLength ()
 
 checkRequiredFields ($user, $billingAddress, $deliveryAddress)
 
 checkCountries ($user, $invAddress, $deliveryAddress)
 
 checkVatId ($user, $invAddress)
 
 getFieldValidationErrors ()
 
 getFirstValidationError ()
 
 validatePaymentInputData ($paymentId, &$dynamicValue)
 
 addValidationError ($fieldName, $error)
 
 setCompanyVatInValidator ($companyVatInValidator)
 
 getCompanyVatInValidator ($country)
 

Public Attributes

const INVALID_ACCOUNT_NUMBER = -5
 
const INVALID_BANK_CODE = -4
 

Protected Member Functions

 _getCountry ($countryId)
 
 _addValidationError ($fieldName, $error)
 
 _validateDebitNote ($debitInformation)
 
 _validateOldDebitInfo ($debitInfo)
 
 _fixAccountNumber ($debitInfo)
 
 _isAllBankInformationSet ($requiredFields, $bankInformation)
 
 _cleanDebitInformation ($debitInformation)
 
 _hasRequiredParametersForVatInCheck ($invAddress)
 

Protected Attributes

 $_aRequiredCCFields
 
 $_aInputValidationErrors = []
 
 $_oCompanyVatInValidator = null
 
 $_aPossibleCCType
 
 $_aRequiredDCFields
 

Private Member Functions

 _setFields ($object, $fields)
 

Detailed Description

Class for validating input.

Constructor & Destructor Documentation

◆ __construct()

OxidEsales\EshopCommunity\Core\InputValidator::__construct ( )

Class constructor. The constructor is defined in order to be possible to call parent::__construct() in modules.

Member Function Documentation

◆ _addValidationError()

OxidEsales\EshopCommunity\Core\InputValidator::_addValidationError (   $fieldName,
  $error 
)
protected

Used to collect user validation errors. This method is called from all of the input checking functionality to report found error.

Deprecated:
since v6.0.0(2017-12-22); Use addValidationError.
Parameters
string$fieldNameField name.
StandardException$errorException.
Returns
StandardException

◆ _cleanDebitInformation()

OxidEsales\EshopCommunity\Core\InputValidator::_cleanDebitInformation (   $debitInformation)
protected

Clean up spaces.

Parameters
array$debitInformationDebit information.
Returns
mixed
Deprecated:
underscore prefix violates PSR12, will be renamed to "cleanDebitInformation" in next major

◆ _fixAccountNumber()

OxidEsales\EshopCommunity\Core\InputValidator::_fixAccountNumber (   $debitInfo)
protected

If account number is shorter than 10, add zeros in front of number.

Parameters
array$debitInfoDebit info.
Returns
array
Deprecated:
underscore prefix violates PSR12, will be renamed to "fixAccountNumber" in next major

◆ _getCountry()

OxidEsales\EshopCommunity\Core\InputValidator::_getCountry (   $countryId)
protected

Load and return Country object.

Parameters
string$countryId
Returns
\OxidEsales\Eshop\Application\Model\Country
Deprecated:
underscore prefix violates PSR12, will be renamed to "getCountry" in next major

◆ _hasRequiredParametersForVatInCheck()

OxidEsales\EshopCommunity\Core\InputValidator::_hasRequiredParametersForVatInCheck (   $invAddress)
protected

Check if all need parameters entered.

Parameters
array$invAddressAddress.
Returns
bool
Deprecated:
underscore prefix violates PSR12, will be renamed to "hasRequiredParametersForVatInCheck" in next major

◆ _isAllBankInformationSet()

OxidEsales\EshopCommunity\Core\InputValidator::_isAllBankInformationSet (   $requiredFields,
  $bankInformation 
)
protected

Checks if all bank information is set.

Parameters
array$requiredFieldsfields must be set.
array$bankInformationactual information.
Returns
bool
Deprecated:
underscore prefix violates PSR12, will be renamed to "isAllBankInformationSet" in next major

◆ _setFields()

OxidEsales\EshopCommunity\Core\InputValidator::_setFields (   $object,
  $fields 
)
private

Creates oxAddress object from given array.

Parameters
User | Address$object
array$fields
Returns
User|Address

◆ _validateDebitNote()

OxidEsales\EshopCommunity\Core\InputValidator::_validateDebitNote (   $debitInformation)
protected

Validates debit note.

Parameters
array$debitInformationDebit information
Returns
bool|int
Deprecated:
underscore prefix violates PSR12, will be renamed to "validateDebitNote" in next major

◆ _validateOldDebitInfo()

OxidEsales\EshopCommunity\Core\InputValidator::_validateOldDebitInfo (   $debitInfo)
protected

Validates old debit info.

Parameters
array$debitInfoDebit info
Returns
bool|int
Deprecated:
underscore prefix violates PSR12, will be renamed to "validateOldDebitInfo" in next major

◆ addValidationError()

OxidEsales\EshopCommunity\Core\InputValidator::addValidationError (   $fieldName,
  $error 
)

Used to collect user validation errors. This method is called from all of the input checking functionality to report found error.

Parameters
string$fieldName
StandardException$error
Returns
StandardException

◆ checkCountries()

OxidEsales\EshopCommunity\Core\InputValidator::checkCountries (   $user,
  $invAddress,
  $deliveryAddress 
)

Checks if user defined countries (billing and delivery) are active.

Parameters
User$userActive user.
array$invAddressBilling address info.
array$deliveryAddressDelivery address info.

◆ checkEmail()

OxidEsales\EshopCommunity\Core\InputValidator::checkEmail (   $user,
  $email 
)

Checks if email (used as login) is not empty and is valid.

Parameters
User$userActive user.
string$emailUser email/login.
Returns
null

◆ checkLogin()

OxidEsales\EshopCommunity\Core\InputValidator::checkLogin (   $user,
  $login,
  $invAddress 
)

Checks if user name does not break logic:

  • if user wants to UPDATE his login name, performing check if user entered correct password
  • additionally checking for user name duplicates. This is usually needed when creating new users. On any error exception is thrown.
Parameters
User$userActive user.
string$loginUser preferred login name.
array$invAddressUser information.
Returns
string login name

◆ checkPassword()

OxidEsales\EshopCommunity\Core\InputValidator::checkPassword (   $user,
  $newPassword,
  $confirmationPassword,
  $shouldCheckPasswordLength = false 
)

Checking if user password is fine. In case of error exception is thrown

Parameters
User$userActive user.
string$newPasswordNew user password.
string$confirmationPasswordRetyped user password.
bool$shouldCheckPasswordLengthOption to check password length.
Returns
Exception\StandardException|null

◆ checkRequiredFields()

OxidEsales\EshopCommunity\Core\InputValidator::checkRequiredFields (   $user,
  $billingAddress,
  $deliveryAddress 
)

Checking if all required fields were filled. In case of error exception is thrown

Parameters
User$userActive user.
array$billingAddressBilling address.
array$deliveryAddressDelivery address.

◆ checkVatId()

OxidEsales\EshopCommunity\Core\InputValidator::checkVatId (   $user,
  $invAddress 
)

Checks if user passed VAT id is valid. Exception is thrown if id is not valid.

Parameters
User$userActive user.
array$invAddressUser input array.
Returns
null

◆ getCompanyVatInValidator()

OxidEsales\EshopCommunity\Core\InputValidator::getCompanyVatInValidator (   $country)

Return VAT IN validator.

Parameters
\OxidEsales\Eshop\Application\Model\Country$countryCountry according which VAT id should be checked.
Returns
\OxidEsales\Eshop\Core\CompanyVatInValidator

◆ getFieldValidationErrors()

OxidEsales\EshopCommunity\Core\InputValidator::getFieldValidationErrors ( )

Returns error array if input validation for current field and rule reported an error

Returns
array

◆ getFirstValidationError()

OxidEsales\EshopCommunity\Core\InputValidator::getFirstValidationError ( )

Returns first user input validation error.

Returns
StandardException

◆ getPasswordLength()

OxidEsales\EshopCommunity\Core\InputValidator::getPasswordLength ( )

Min length of password.

Returns
int

◆ setCompanyVatInValidator()

OxidEsales\EshopCommunity\Core\InputValidator::setCompanyVatInValidator (   $companyVatInValidator)

VAT IN validator setter.

Parameters
\OxidEsales\Eshop\Core\CompanyVatInValidator$companyVatInValidatorvalidator

◆ validateBasketAmount()

OxidEsales\EshopCommunity\Core\InputValidator::validateBasketAmount (   $amount)

Validates basket amount.

Parameters
float$amountAmount of article.
Exceptions
ArticleInputExceptionIf amount is not numeric or smaller 0.
Returns
float

◆ validatePaymentInputData()

OxidEsales\EshopCommunity\Core\InputValidator::validatePaymentInputData (   $paymentId,
$dynamicValue 
)

Validates payment input data for credit card and debit note.

Parameters
string$paymentIdThe payment id of current payment.
array$dynamicValueValues of payment.
Returns
bool

Member Data Documentation

◆ $_aInputValidationErrors

OxidEsales\EshopCommunity\Core\InputValidator::$_aInputValidationErrors = []
protected

◆ $_aPossibleCCType

OxidEsales\EshopCommunity\Core\InputValidator::$_aPossibleCCType
protected
Initial value:
= ['mcd',
'vis',
'amx',
'dsc',
'dnc',
'jcb',
'swi',
'dlt',
'enr'
]

◆ $_aRequiredCCFields

OxidEsales\EshopCommunity\Core\InputValidator::$_aRequiredCCFields
protected
Initial value:
= ['kktype',
'kknumber',
'kkmonth',
'kkyear',
'kkname',
'kkpruef'
]

◆ $_aRequiredDCFields

OxidEsales\EshopCommunity\Core\InputValidator::$_aRequiredDCFields
protected
Initial value:
= ['lsbankname',
'lsktonr',
'lsktoinhaber'
]

◆ $_oCompanyVatInValidator

OxidEsales\EshopCommunity\Core\InputValidator::$_oCompanyVatInValidator = null
protected

◆ INVALID_ACCOUNT_NUMBER

const OxidEsales\EshopCommunity\Core\InputValidator::INVALID_ACCOUNT_NUMBER = -5

Invalid account number error code for template.

◆ INVALID_BANK_CODE

const OxidEsales\EshopCommunity\Core\InputValidator::INVALID_BANK_CODE = -4

Invalid bank number error code for template.


The documentation for this class was generated from the following file: