Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • ApiV2Controllers
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • None
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

  • AbstractCustomerServiceFactory
  • Customer
  • CustomerDeleter
  • CustomerFactory
  • CustomerReader
  • CustomerReadService
  • CustomerRepository
  • CustomerService
  • CustomerServiceFactory
  • CustomerWriter
  • CustomerWriteService

Class CustomerService

Class CustomerService

This class provides methods for creating and deleting customer data

CustomerService implements CustomerServiceInterface
Package: Customer
Category: System
Implements: CustomerServiceInterface
Located at CoreServices/Customer/CustomerService.inc.php

Methods summary

public
# __construct( CustomerReadServiceInterface $customerReadService, CustomerWriteServiceInterface $customerWriteService )

Constructor of the class CustomerService.

Constructor of the class CustomerService.

Parameters

$customerReadService
Customer read service.
$customerWriteService
Customer write service.
public Customer
# createNewCustomer( CustomerEmailInterface $email, CustomerPasswordInterface $password, DateTime $dateOfBirth, CustomerVatNumberInterface $vatNumber, CustomerCallNumberInterface $telephoneNumber, CustomerCallNumberInterface $faxNumber, AddressBlockInterface $addressBlock )

Creates a new customer with the given parameters.

Creates a new customer with the given parameters.

Parameters

$email
Customer's E-Mail address.
$password
Customer's password.
$dateOfBirth
Customer's date of birth.
$vatNumber
Customer's VAT number.
$telephoneNumber
Customer's telephone number.
$faxNumber
Customer's fax number.
$addressBlock
Customer's address.

Returns

Customer
Created customer.

Throws

UnexpectedValueException

On invalid arguments.

TODO Replaced by VAT Check TODO Rename to createNewRegistree

Implementation of

CustomerServiceInterface::createNewCustomer()
public Customer
# createNewGuest( CustomerEmailInterface $email, DateTime $dateOfBirth, CustomerVatNumberInterface $vatNumber, CustomerCallNumberInterface $telephoneNumber, CustomerCallNumberInterface $faxNumber, AddressBlockInterface $addressBlock )

Creates a new guest account with the given parameters.

Creates a new guest account with the given parameters.

Parameters

$email
Customer's E-Mail address.
$dateOfBirth
Customer's date of birth.
$vatNumber
Customer's VAT number.
$telephoneNumber
Customer's telephone number.
$faxNumber
Customer's fax number.
$addressBlock
Customer's address.

Returns

Customer
Created guest customer.

Throws

UnexpectedValueException
On invalid arguments.

Implementation of

CustomerServiceInterface::createNewGuest()
public Customer
# getCustomerById( IdType $customerId )

Finds a customer by its ID.

Finds a customer by its ID.

Parameters

$customerId
Customer's ID.

Returns

Customer
Customer.
public
# deleteCustomerById( IdType $customerId )

Deletes the customer by its ID.

Deletes the customer by its ID.

Parameters

$customerId
Customer's ID.
public boolean
# registreeEmailExists( CustomerEmailInterface $email )

Checks if the email address of the registree already exists.

Checks if the email address of the registree already exists.

Parameters

$email
Customer's E-Mail address.

Returns

boolean
Does the provided E-Mail address already exist?

Implementation of

CustomerServiceInterface::registreeEmailExists()
public CustomerInterface
# updateCustomer( CustomerInterface $customer )

Updates customer data.

Updates customer data.

Parameters

$customer
Customer.

Returns

CustomerInterface
Updated customer.

Implementation of

CustomerServiceInterface::updateCustomer()
public boolean
# addressIsDefaultCustomerAddress( CustomerAddressInterface $customerAddress )

Checks if address is the default address of the customer.

Checks if address is the default address of the customer.

Parameters

$customerAddress
Customer's address.

Returns

boolean
Is the provided address the customer's default address?

Implementation of

CustomerServiceInterface::addressIsDefaultCustomerAddress()
public array
# filterCustomers( array $conditions = array(), integer $limit = null, integer $offset = null )

Filters customer records and returns an array with results.

Filters customer records and returns an array with results.

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

Parameters

$conditions
Associative array containing the desired field and value.
$limit
MySQL limit applied to the records.
$offset
MySQL offset applied to the records.

Returns

array
Returns an array that contains customer objects.

Properties summary

protected CustomerReadServiceInterface $customerReadService

Customer read service.

Customer read service.

#
protected CustomerWriteServiceInterface $customerWriteService

Customer write service.

Customer write service.

#
API documentation generated by ApiGen