Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • AdminHttpViewControllers
  • ApiV2Controllers
  • Authentication
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Strategies
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Storages
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Extensions
    • Customers
    • Emails
    • Helpers
    • Invoices
    • Orders
    • Serializers
    • Templates
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • HttpViewControllers
  • InfoBox
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
  • Invoice
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • Modules
    • Collections
    • Controllers
    • Interfaces
  • None
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Precheck
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • ClassFinder
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • SharedShoppingCart
    • Interfaces
  • Slider
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

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

Class CustomerReader

Class CustomerReader

This class is used for reading customer data from the database

CustomerReader implements CustomerReaderInterface
Package: Customer
Category: System
Implements: CustomerReaderInterface
Located at Services/Core/Customer/CustomerReader.inc.php

Methods summary

public
# __construct( AbstractCustomerFactory $customerFactory, CustomerAddressRepositoryInterface $customerAddressRepository, CI_DB_query_builder $dbQueryBuilder )

Constructor of the class CustomerReader.

Constructor of the class CustomerReader.

CrossCuttingLoader dependencies: - StringHelper

Parameters

$customerFactory
Customer factory.
$customerAddressRepository
Customer address repository.
$dbQueryBuilder
Query builder.
public Customer|null
# findById( IdType $id )

Finds a customer by the given ID.

Finds a customer by the given ID.

Parameters

$id
Customer's ID.

Returns

Customer|null
Customer or null if not found.

Implementation of

CustomerReaderInterface::findById()
public Customer|null
# findRegistreeByEmail( CustomerEmailInterface $email )

Finds a registree by email address.

Finds a registree by email address.

Parameters

$email
Customer's E-Mail address.

Returns

Customer|null
Customer or null if not found.

Implementation of

CustomerReaderInterface::findRegistreeByEmail()
public Customer|null
# findGuestByEmail( CustomerEmailInterface $email )

Finds a guest by email address.

Finds a guest by email address.

Parameters

$email
Customer's E-Mail address.

Returns

Customer|null
Customer or null if not found.

Implementation of

CustomerReaderInterface::findGuestByEmail()
protected Customer|null
# _findByFilter( array $filterArray )

Helper method which searches for user data based on an applied filter.

Helper method which searches for user data based on an applied filter.

Parameters

$filterArray
Filters.

Returns

Customer|null
Customer or null if not found.
protected Customer
# _createCustomerByArray( array $customerDataArray )

Creates a customer based on the provided data.

Creates a customer based on the provided data.

Parameters

$customerDataArray
Customer data.

Returns

Customer
$customer Created customer.

Todo

If date of birth is null in the database then: $customerDataArray['customers_dob'] = '0000-00-00 00:00:00' and then the getDateOfBirth() will return wrong results ($customer->getDateOfBirth() >> -0001-11-30 00:00:00).


public array
# filterCustomers( array $conditions = [], 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: $reader->filterCustomers( array('customers_id' => 1) );

Parameters

$conditions
Associative array containing the desired field and value.
$limit
MySQL limit index.
$offset
Number of records to be returned.

Returns

array
Returns an array that contains customer objects.
public integer
# getFilterCustomersCount( array $conditions = [] )

Filters customer records and returns the total count.

Filters customer records and returns the total count.

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

Parameters

$conditions
Associative array containing the desired field and value.

Returns

integer
Returns the total customers count.

Implementation of

CustomerReaderInterface::getFilterCustomersCount()

Properties summary

protected CI_DB_query_builder $db

Query builder.

Query builder.

#
protected AbstractCustomerFactory $customerFactory

Customer factory.

Customer factory.

#
protected CustomerAddressRepositoryInterface $customerAddressRepository

Customer address repository.

Customer address repository.

#
protected StringHelperInterface $stringHelper

String helper.

String helper.

#
protected boolean $isGuest

Is customer a guest?

Is customer a guest?

#
API documentation generated by ApiGen