CustomerWriter
in package
Class CustomerWriter
Table of Contents
- $connection : Connection
- $vatValidationService : VatValidationService
- __construct() : mixed
- createCustomer() : int
- Creates a new customer and returns its ID.
- createMultipleCustomers() : array<string|int, int>
- Creates multiple customers and returns their IDs.
- deleteCustomers() : void
- Deletes customers based on the given customer IDs.
- deleteOutdatedGuestAccounts() : array<string|int, int>
- Deletes all guests customers
- storeCustomers() : void
- Stores multiple customers.
- deleteCustomer() : void
- deleteGuestByEmail() : void
- Deletes a guest account by its email address.
- emailAddressIsAlreadyTaken() : bool
- storeCustomer() : void
Properties
$connection
private
Connection
$connection
$vatValidationService
private
VatValidationService
$vatValidationService
Methods
__construct()
public
__construct(Connection $connection, VatValidationService $vatValidationService) : mixed
Parameters
- $connection : Connection
- $vatValidationService : VatValidationService
Return values
mixed —createCustomer()
Creates a new customer and returns its ID.
public
createCustomer(CustomerGroup $customerGroup, PersonalInformation $personalInformation, BusinessInformation $businessInformation, ContactInformation $contactInformation, CustomerCredit $credit, bool $isFavorite, bool $isGuestAccount) : int
Parameters
- $customerGroup : CustomerGroup
- $personalInformation : PersonalInformation
- $businessInformation : BusinessInformation
- $contactInformation : ContactInformation
- $credit : CustomerCredit
- $isFavorite : bool
- $isGuestAccount : bool
Tags
Return values
int —createMultipleCustomers()
Creates multiple customers and returns their IDs.
public
createMultipleCustomers(array<string|int, mixed> ...$creationArguments) : array<string|int, int>
Parameters
- $creationArguments : array<string|int, mixed>
Tags
Return values
array<string|int, int> —deleteCustomers()
Deletes customers based on the given customer IDs.
public
deleteCustomers(CustomerId ...$ids) : void
Parameters
- $ids : CustomerId
Tags
Return values
void —deleteOutdatedGuestAccounts()
Deletes all guests customers
public
deleteOutdatedGuestAccounts() : array<string|int, int>
Return values
array<string|int, int> —storeCustomers()
Stores multiple customers.
public
storeCustomers(Customer ...$customers) : void
Parameters
- $customers : Customer
Tags
Return values
void —deleteCustomer()
private
deleteCustomer(CustomerId $id) : void
Parameters
- $id : CustomerId
Tags
Return values
void —deleteGuestByEmail()
Deletes a guest account by its email address.
private
deleteGuestByEmail(string $email) : void
Parameters
- $email : string
-
Guest customer's E-Mail address.
Return values
void —emailAddressIsAlreadyTaken()
private
emailAddressIsAlreadyTaken(string $email[, int|null $customerId = null ]) : bool
Parameters
- $email : string
- $customerId : int|null = null
Return values
bool —storeCustomer()
private
storeCustomer(Customer $customer) : void
Parameters
- $customer : Customer