CustomerConfigurationProvider

Class CustomerConfigurationProvider

package

Default

Methods

CustomerConfigurationProvider constructor.

__construct(\CI_DB_query_builder $db, \LanguageTextManager $languageTextManager) 

Arguments

$db

\CI_DB_query_builder

Database access, required to fetch configurations.

$languageTextManager

\LanguageTextManager

Text manager to fetch error messages.

Checks if given configuration field exists.

checkIfFieldExists(\StringType $configField, array $fields) : $this|\CustomerConfigurationProvider
Throws
\InvalidArgumentException

If provided config field do not exist.

Arguments

$configField

\StringType

Expected configuration field.

$fields

array

Allowed configuration fields.

Response

$this|\CustomerConfigurationProvider

Same instance for chained method calls.

Checks if given configuration is enabled.

configuration(\StringType $configField) : boolean

Allowed fields are 'acceptPrivacy', 'optionalNames', 'splitStreetInformation'.

Arguments

$configField

\StringType

Determines for which configuration field should be checked.

Response

boolean

True if configuration is enabled and false otherwise.

Provides the default status id for customers and guests.

defaultStatusId(\StringType $configField) : integer

Allowed fields are 'customer' and 'guest'.

Arguments

$configField

\StringType

Either 'guest' or 'customer'.

Response

integer

Default status id of given config field.

Should the provided configuration field be displayed? Allowed fields are 'gender', 'dob', 'dateOfBirth', 'company', 'state', 'telephone', 'fax', 'suburb'.

display(\StringType $configField) : boolean

Arguments

$configField

\StringType

Determines for which configuration field the display check should be performed.

Response

boolean

True if provided configuration field should be displayed and false otherwise.

Error message for provided configuration field.

errorMessage(\StringType $configField) : string

Allowed fields are 'gender', 'firstName', 'lastName', 'dateOfBirth', 'company', 'vatNumber', 'email', 'emailAddressCheck', 'emailConfirmation', 'emailExists', 'street', 'houseNumber', 'postcode', 'city', 'country', 'countryZone', 'countryZoneSelection', 'telephone', 'password', 'passwordMismatch', 'privacy', 'invalidInput'.

Arguments

$configField

\StringType

Determines for which configuration field the error message should be provided.

Response

string

Error message of provided configuration field.

Minimum length of provided configuration field.

minLength(\StringType $configField) : integer

Allowed fields are 'firstName', 'lastName', 'dateOfBirth', 'dob', 'email', 'street', 'houseNumber', 'company', 'postcode', 'city', 'countryZone', 'suburb', 'state', 'telephone', 'password'.

Arguments

$configField

\StringType

Determines for which configuration field the minimum length should be provided.

Response

integer

Minimum length of provided configuration field.

Properties

db

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

languageTextManager

languageTextManager : \LanguageTextManager
var

Type(s)

\LanguageTextManager

minLength

minLength : array
static
var

Type(s)

array

display

display : array
static
var

Type(s)

array

errorMessages

errorMessages : array
static
var

Type(s)

array

configuration

configuration : array
static
var

Type(s)

array

defaultStatusId

defaultStatusId : 
static

Type(s)

configurationTable

configurationTable : array
static
var

Type(s)

array

gmConfigurationTable

gmConfigurationTable : array
static
var

Type(s)

array