CustomerWriteService

Implements \CustomerWriteServiceInterface

Class CustomerWriteService

This class provides methods for creating and deleting customer data

category

System

package

Customer

implements

CustomerWriteServiceInterface

Methods

Constructor of the class CustomerService.

__construct(\AddressBookServiceInterface $addressBookService, \CustomerRepositoryInterface $customerRepository, \CustomerServiceSettingsInterface $customerServiceSettings, \VatNumberValidatorInterface $vatNumberValidator, \DeleteHistoryWriteService $deleteHistoryWriteService) 

Arguments

$addressBookService

\AddressBookServiceInterface

Address book service.

$customerRepository

\CustomerRepositoryInterface

Customer repository.

$customerServiceSettings

\CustomerServiceSettingsInterface

Customer service settings.

$vatNumberValidator

\VatNumberValidatorInterface

VAT number validator.

$deleteHistoryWriteService

\DeleteHistoryWriteService

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
deprecated

use createNewRegistree() with an instance of CustomerGuestPassword

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.

Creates a new customer with the given parameters.

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

Will create a guest account if $password is an instance of CustomerGuestPassword.

Throws
\UnexpectedValueException

On invalid arguments.

TODO Replaced by Vat Check

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.

Deletes the customer with the provided ID.

deleteCustomerById(\IdType $customerId) 

Arguments

$customerId

\IdType

Customer's ID.

Updates customer data.

updateCustomer(\CustomerInterface $customer) : \CustomerInterface

Arguments

$customer

\CustomerInterface

Customer.

Response

\CustomerInterface

Updated customer.

TODO check if the new email address is used by another record

Properties

Address book service.

addressBookService : \AddressBookServiceInterface

Customer repository.

customerRepository : \CustomerRepositoryInterface

Customer service settings.

customerServiceSettings : \CustomerServiceSettingsInterface

VAT number validator.

vatNumberValidator : \VatNumberValidatorInterface

deleteHistory

deleteHistory : \DeleteHistoryWriteService