phpDocumentor

CustomerService
in package
implements CustomerServiceInterface

Class CustomerService

This class provides methods for creating and deleting customer data

Tags
category

System

implements

CustomerServiceInterface

Interfaces, Classes and Traits

CustomerServiceInterface
Interface CustomerServiceInterface

Table of Contents

$customerReadService  : CustomerReadServiceInterface
Customer read service.
$customerWriteService  : CustomerWriteServiceInterface
Customer write service.
__construct()  : mixed
Constructor of the class CustomerService.
addressIsDefaultCustomerAddress()  : bool
Checks if address is the default address of the customer.
createNewCustomer()  : Customer
Creates a new customer with the given parameters.
createNewGuest()  : Customer
Creates a new guest account with the given parameters.
deleteCustomerById()  : mixed
Deletes the customer by its ID.
filterCustomers()  : array<string|int, mixed>
Filters customer records and returns an array with results.
getCustomerById()  : Customer
Finds a customer by its ID.
registreeEmailExists()  : bool
Checks if the email address of the registree already exists.
updateCustomer()  : CustomerInterface
Updates customer data.

Properties

Methods

addressIsDefaultCustomerAddress()

Checks if address is the default address of the customer.

public addressIsDefaultCustomerAddress(CustomerAddressInterface $customerAddress) : bool
Parameters
$customerAddress : CustomerAddressInterface

Customer's address.

Return values
bool

Is the provided address the customer's default address?

createNewCustomer()

Creates a new customer with the given parameters.

public createNewCustomer(CustomerEmailInterface $email, CustomerPasswordInterface $password, DateTime $dateOfBirth, CustomerVatNumberInterface $vatNumber, CustomerCallNumberInterface $telephoneNumber, CustomerCallNumberInterface $faxNumber, AddressBlockInterface $addressBlock, KeyValueCollection $addonValues[, CustomerNumberInterface|null $customerNumber = null ]) : Customer
Parameters
$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.

$customerNumber : CustomerNumberInterface|null = null

Customer's number.

Tags
throws
UnexpectedValueException

On invalid arguments.

TODO Replaced by VAT Check TODO Rename to createNewRegistree

Return values
Customer

Created customer.

createNewGuest()

Creates a new guest account with the given parameters.

public createNewGuest(CustomerEmailInterface $email, DateTime $dateOfBirth, CustomerVatNumberInterface $vatNumber, CustomerCallNumberInterface $telephoneNumber, CustomerCallNumberInterface $faxNumber, AddressBlockInterface $addressBlock, KeyValueCollection $addonValues[, CustomerNumberInterface|null $customerNumber = null ]) : Customer
Parameters
$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.

$customerNumber : CustomerNumberInterface|null = null

Customer's number.

Tags
throws
UnexpectedValueException

On invalid arguments.

Return values
Customer

Created guest customer.

deleteCustomerById()

Deletes the customer by its ID.

public deleteCustomerById(IdType $customerId) : mixed
Parameters
$customerId : IdType

Customer's ID.

Return values
mixed

filterCustomers()

Filters customer records and returns an array with results.

public filterCustomers([array<string|int, mixed> $conditions = [] ][, Pager|null $pager = null ][, array<string|int, mixed> $sorters = [] ]) : array<string|int, mixed>

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

Parameters
$conditions : array<string|int, mixed> = []

Associative array containing the desired field and value.

$pager : Pager|null = null

(Optional) Pager object with pagination information

$sorters : array<string|int, mixed> = []

(Optional) array of Sorter objects with data sorting information

Return values
array<string|int, mixed>

Returns an array that contains customer objects.

Search results