CustomerService

Implements \CustomerServiceInterface

Class CustomerService

This class provides methods for creating and deleting customer data

category

System

package

Customer

implements

CustomerServiceInterface

Methods

Constructor of the class CustomerService.

__construct(\CustomerReadServiceInterface $customerReadService, \CustomerWriteServiceInterface $customerWriteService) 

Arguments

$customerReadService

\CustomerReadServiceInterface

Customer read service.

$customerWriteService

\CustomerWriteServiceInterface

Customer write service.

Checks if address is the default address of the customer.

addressIsDefaultCustomerAddress(\CustomerAddressInterface $customerAddress) : boolean

Arguments

$customerAddress

\CustomerAddressInterface

Customer's address.

Response

boolean

Is the provided address the customer's default address?

Creates a new customer with the given parameters.

createNewCustomer(\CustomerEmailInterface $email, \CustomerPasswordInterface $password, \DateTime $dateOfBirth, \CustomerVatNumberInterface $vatNumber, \CustomerCallNumberInterface $telephoneNumber, \CustomerCallNumberInterface $faxNumber, \AddressBlockInterface $addressBlock, \KeyValueCollection $addonValues) : \Customer
Throws
\UnexpectedValueException

On invalid arguments.

TODO Replaced by VAT Check TODO Rename to createNewRegistree

Arguments

$email

\CustomerEmailInterface

Customer's E-Mail address.

$password

\CustomerPasswordInterface

Customer's password.

$dateOfBirth

\DateTime

Customer's date of birth.

$vatNumber

\CustomerVatNumberInterface

Customer's VAT number.

$telephoneNumber

\CustomerCallNumberInterface

Customer's telephone number.

$faxNumber

\CustomerCallNumberInterface

Customer's fax number.

$addressBlock

\AddressBlockInterface

Customer's address.

$addonValues

\KeyValueCollection

Customer's additional values.

Response

\Customer

Created customer.

Creates a new guest account with the given parameters.

createNewGuest(\CustomerEmailInterface $email, \DateTime $dateOfBirth, \CustomerVatNumberInterface $vatNumber, \CustomerCallNumberInterface $telephoneNumber, \CustomerCallNumberInterface $faxNumber, \AddressBlockInterface $addressBlock, \KeyValueCollection $addonValues) : \Customer
Throws
\UnexpectedValueException

On invalid arguments.

Arguments

$email

\CustomerEmailInterface

Customer's E-Mail address.

$dateOfBirth

\DateTime

Customer's date of birth.

$vatNumber

\CustomerVatNumberInterface

Customer's VAT number.

$telephoneNumber

\CustomerCallNumberInterface

Customer's telephone number.

$faxNumber

\CustomerCallNumberInterface

Customer's fax number.

$addressBlock

\AddressBlockInterface

Customer's address.

$addonValues

\KeyValueCollection

Customer's additional values.

Response

\Customer

Created guest customer.

Deletes the customer by its ID.

deleteCustomerById(\IdType $customerId) 

Arguments

$customerId

\IdType

Customer's ID.

Filters customer records and returns an array with results.

filterCustomers(array $conditions = array(), integer $limit = null, integer $offset = null) : array

Example: $service->filterCustomers('customers_id' => 1);

Arguments

$conditions

array

Associative array containing the desired field and value.

$limit

integer

MySQL limit applied to the records.

$offset

integer

MySQL offset applied to the records.

Response

array

Returns an array that contains customer objects.

Finds a customer by its ID.

getCustomerById(\IdType $customerId) : \Customer

Arguments

$customerId

\IdType

Customer's ID.

Response

\Customer

Customer.

Checks if the email address of the registree already exists.

registreeEmailExists(\CustomerEmailInterface $email) : boolean

Arguments

$email

\CustomerEmailInterface

Customer's E-Mail address.

Response

boolean

Does the provided E-Mail address already exist?

Updates customer data.

updateCustomer(\CustomerInterface $customer) : \CustomerInterface

Arguments

$customer

\CustomerInterface

Customer.

Response

\CustomerInterface

Updated customer.

Properties

Customer read service.

customerReadService : \CustomerReadServiceInterface

Customer write service.

customerWriteService : \CustomerWriteServiceInterface