OXID eShop CE  6.1.5
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 ($dAmount)
 
 checkLogin ($oUser, $sLogin, $aInvAddress)
 
 checkEmail ($oUser, $sEmail)
 
 checkPassword ($oUser, $sNewPass, $sConfPass, $blCheckLength=false)
 
 getPasswordLength ()
 
 checkRequiredFields ($oUser, $aBillingAddress, $aDeliveryAddress)
 
 checkCountries ($oUser, $aInvAddress, $aDelAddress)
 
 checkVatId ($oUser, $aInvAddress)
 
 getFieldValidationErrors ()
 
 getFirstValidationError ()
 
 validatePaymentInputData ($sPaymentId, & $aDynValue)
 
 addValidationError ($sFieldName, $oErr)
 
 setCompanyVatInValidator ($oCompanyVatInValidator)
 
 getCompanyVatInValidator ($oCountry)
 

Public Attributes

const INVALID_ACCOUNT_NUMBER = -5
 
const INVALID_BANK_CODE = -4
 

Protected Member Functions

 _getCountry ($sCountryId)
 
 _addValidationError ($sFieldName, $oErr)
 
 _validateDebitNote ($debitInformation)
 
 _validateOldDebitInfo ($aDebitInfo)
 
 _fixAccountNumber ($aDebitInfo)
 
 _isAllBankInformationSet ($aRequiredFields, $aBankInformation)
 
 _cleanDebitInformation ($aDebitInformation)
 
 _hasRequiredParametersForVatInCheck ($aInvAddress)
 

Protected Attributes

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

Private Member Functions

 _setFields ($oObject, $aFields)
 

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 (   $sFieldName,
  $oErr 
)
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$sFieldNamefield name
exception$oErrexception
Returns
exception

◆ _cleanDebitInformation()

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

Clean up spaces.

Parameters
array$aDebitInformationDebit information
Returns
mixed

◆ _fixAccountNumber()

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

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

Parameters
array$aDebitInfoDebit info
Returns
array

◆ _getCountry()

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

Load and return oxCountry

Parameters
string$sCountryId
Returns
\OxidEsales\Eshop\Application\Model\Country

◆ _hasRequiredParametersForVatInCheck()

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

Check if all need parameters entered

Parameters
array$aInvAddressAddress
Returns
bool

◆ _isAllBankInformationSet()

OxidEsales\EshopCommunity\Core\InputValidator::_isAllBankInformationSet (   $aRequiredFields,
  $aBankInformation 
)
protected

Checks if all bank information is set.

Parameters
array$aRequiredFieldsfields must be set.
array$aBankInformationactual information.
Returns
bool

◆ _setFields()

OxidEsales\EshopCommunity\Core\InputValidator::_setFields (   $oObject,
  $aFields 
)
private

Creates oxAddress object from given array.

Parameters
\OxidEsales\Eshop\Application\Model\User | oxAddress$oObject
array$aFields
Returns
\OxidEsales\Eshop\Application\Model\User|oxAddress

◆ _validateDebitNote()

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

Validates debit note.

Parameters
array$debitInformation
Returns
bool|int

◆ _validateOldDebitInfo()

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

Validates old debit info.

Parameters
array$aDebitInfoDebit info
Returns
bool|int

◆ addValidationError()

OxidEsales\EshopCommunity\Core\InputValidator::addValidationError (   $sFieldName,
  $oErr 
)

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

Parameters
string$sFieldNamefield name
exception$oErrexception
Returns
exception

◆ checkCountries()

OxidEsales\EshopCommunity\Core\InputValidator::checkCountries (   $oUser,
  $aInvAddress,
  $aDelAddress 
)

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

Parameters
\OxidEsales\Eshop\Application\Model\User$oUseractive user
array$aInvAddressbilling address info
array$aDelAddressdelivery address info

◆ checkEmail()

OxidEsales\EshopCommunity\Core\InputValidator::checkEmail (   $oUser,
  $sEmail 
)

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

Parameters
\OxidEsales\Eshop\Application\Model\User$oUseractive user
string$sEmailuser email/login
Returns
null

◆ checkLogin()

OxidEsales\EshopCommunity\Core\InputValidator::checkLogin (   $oUser,
  $sLogin,
  $aInvAddress 
)

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
\OxidEsales\Eshop\Application\Model\User$oUseractive user
string$sLoginuser preferred login name
array$aInvAddressuser information
Returns
string login name

◆ checkPassword()

OxidEsales\EshopCommunity\Core\InputValidator::checkPassword (   $oUser,
  $sNewPass,
  $sConfPass,
  $blCheckLength = false 
)

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

Parameters
\OxidEsales\Eshop\Application\Model\User$oUseractive user
string$sNewPassnew user password
string$sConfPassretyped user password
bool$blCheckLengthoption to check password length
Returns
oxException|null

◆ checkRequiredFields()

OxidEsales\EshopCommunity\Core\InputValidator::checkRequiredFields (   $oUser,
  $aBillingAddress,
  $aDeliveryAddress 
)

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

Parameters
\OxidEsales\Eshop\Application\Model\User$oUseractive user
array$aBillingAddressbilling address
array$aDeliveryAddressdelivery address

◆ checkVatId()

OxidEsales\EshopCommunity\Core\InputValidator::checkVatId (   $oUser,
  $aInvAddress 
)

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

Parameters
\OxidEsales\Eshop\Application\Model\User$oUseractive user
array$aInvAddressuser input array
Returns
null

◆ getCompanyVatInValidator()

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

Return VAT IN validator

Parameters
\OxidEsales\Eshop\Application\Model\Country$oCountrycountry 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
exception

◆ getPasswordLength()

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

min length of password

Returns
int

◆ setCompanyVatInValidator()

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

VAT IN validator setter

Parameters
\OxidEsales\Eshop\Core\CompanyVatInValidator$oCompanyVatInValidatorvalidator

◆ validateBasketAmount()

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

Validates basket amount

Parameters
float$dAmountamount of article
Exceptions
oxArticleInputExceptionif amount is not numeric or smaller 0
Returns
float

◆ validatePaymentInputData()

OxidEsales\EshopCommunity\Core\InputValidator::validatePaymentInputData (   $sPaymentId,
$aDynValue 
)

Validates payment input data for credit card and debit note

Parameters
string$sPaymentIdthe payment id of current payment
array$aDynValuevalues 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: