CustomerAddressReader

Extends \AbstractDataPaginator Implements \CustomerAddressReaderInterface

Class CustomerAddressReader

This class is used for reading customer address data from the database

category

System

package

Customer

subpackage

Address

implements

CustomerAddressReaderInterface

Methods

ManufacturerReader constructor.

__construct(\CI_DB_query_builder $query_builder) 
inherited

Arguments

$query_builder

\CI_DB_query_builder

Applies the class default sorting

_applyDefaultSorting() 
inherited abstract

Applies a pagination (Limit and Offset) clause to the currently building query.

_applyPagination(\Pager|null $pager = null) : $this|\ProductListProvider
inherited

Arguments

$pager

\Pager|null

(Optional) Pager object with pagination information

Response

$this|\ProductListProvider

Same instance for chained method calls.

Applies a sorting based on sorter param (if sorting is supplied) or apply default sorting.

_applySorting(array $sorters = array()) : $this|\ProductListProvider
inherited
Throws
\InvalidArgumentException

if some element of the $sorters array is not a instance of Sorter object

Arguments

$sorters

array

Array of Sorter objects.

Response

$this|\ProductListProvider

Same instance for chained method calls.

_createCustomerAddressByArray

_createCustomerAddressByArray(array $addressDataArray) : \CustomerAddress

Arguments

$addressDataArray

array

Response

\CustomerAddress

return the child class Field Map array.

_getFieldMap() : \array.
inherited abstract

Response

\array.

Parse an order by sql query into a array with fieldname and direction.

_parseOrderByString(\StringType|null $orderBy = null) : array
inherited

Arguments

$orderBy

\StringType|null

SQL order by String

Response

array

with sort information structured as ['field'=>'', 'direction'=>''].

Translate an order by sql instruction into a array of Sorter

_translateOrderByStringIntoArrayOfSorter(\StringType|null $orderBy = null) : array
inherited

Arguments

$orderBy

\StringType|null

SQL instruction with fields to sort.

Response

array

of Sorter objects.

Return the related database field of a given object(Entity) field.

_translateToDatabaseField(\string $fieldName) : \string.
inherited
Throws
\InvalidArgumentException

if the provided field name is not a valid mapped field

Arguments

$fieldName

\string

Object Field name.

Response

\string.

Parse an order by sql query into a array with fieldname and direction.

_translateToJsonFieldName(\StringType $databaseFieldName) : string|FALSE
inherited

Arguments

$databaseFieldName

\StringType

the database field name. It can be supplied as table.fieldName or fieldName.

Response

string|FALSE

will return the field name or FALSE if the field doesn't exist.

Filter existing addresses by keyword.

filterAddresses(string $p_keyword, \Pager|null $pager = null, array $sorters = array()) : array

This method is useful when creating a search mechanism for the registered addresses.

Arguments

$p_keyword

string

The keyword to be used for filtering the records.

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

array

Returns an array of CustomerAddress objects.

This method will return an array of all customer's addresses

findAddressesByCustomer(\CustomerInterface $customer) : array

Arguments

$customer

\CustomerInterface

Response

array

containing CustomerAddress objects

Method to find a customer address with a given ID if it exits else it will return null

findById(\IdType $id) : \CustomerAddress

Arguments

$id

\IdType

Response

\CustomerAddress

Get all system addresses.

getAllAddresses(\Pager|null $pager = null, array $sorters = array()) : array

Arguments

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

array

of CustomerAddress

getById

getById(\IdType $id) : \CustomerAddress
Throws
\InvalidArgumentException

Arguments

$id

\IdType

Response

\CustomerAddress

Properties

customerFactory

customerFactory : \AbstractCustomerFactory

countryService

countryService : \CountryServiceInterface

stringHelper

stringHelper : \StringHelperInterface

db

db : \\CI_DB_query_builder
inherited
var

Type(s)

\\CI_DB_query_builder