AddressBookService

Implements \AddressBookServiceInterface

Class AddressBookService

This class is used to manage addresses

category

System

package

Customer

subpackage

Address

implements

AddressBookServiceInterface

Methods

Constructor of the class AddressBookService

__construct(\CustomerAddressRepositoryInterface $addressRepository) 

Arguments

Method to add a new address in the address book

createNewAddress(\AddressBlockInterface $addressBlock, \CustomerInterface $customer) : \CustomerAddressInterface

Arguments

$addressBlock

\AddressBlockInterface

$customer

\CustomerInterface

Response

\CustomerAddressInterface

Method to delete an address from the address book

deleteAddress(\CustomerAddressInterface $address) 

Arguments

Filter registered addresses by string.

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

Arguments

$p_keyword

string

Used to filter the address 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.

findAddressById

findAddressById(\IdType $addressId) : \CustomerAddress|null

Arguments

$addressId

\IdType

Response

\CustomerAddress|null

Get all registered 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

Returns an array of CustomerAddress objects.

Get customer addresses.

getCustomerAddresses(\CustomerInterface $customer) : array

Arguments

$customer

\CustomerInterface

Contains the customer data.

Response

array

Returns an array of CustomerAddress objects.

Method to update an address in the address book

updateAddress(\AddressBlockInterface $addressBlock, \CustomerAddressInterface $address) : \CustomerAddressInterface

updateCustomerAddress

updateCustomerAddress(\CustomerAddressInterface $customerAddress) 

Arguments

$customerAddress

\CustomerAddressInterface

Properties

customerAddressRepository

customerAddressRepository : \CustomerAddressRepositoryInterface