CustomerAddressRepository
in package
implements
CustomerAddressRepositoryInterface
Class CustomerAddressRepository
This class contains basic methods for finding, creating and deleting customer addresses
Tags
Interfaces, Classes and Traits
- CustomerAddressRepositoryInterface
- Interface CustomerAddressRepositoryInterface
Table of Contents
- $customerAddressDeleter : CustomerAddressDeleterInterface
- $customerAddressReader : CustomerAddressReaderInterface
- $customerAddressWriter : CustomerAddressWriterInterface
- $customerFactory : AbstractCustomerFactory
- __construct() : mixed
- Constructor of the class CustomerAddressRepository
- deleteCustomerAddress() : mixed
- Method to delete a customer address
- deleteCustomerAddressesByCustomer() : mixed
- Deletes the customer address
- filterAddresses() : array<string|int, mixed>
- Filter existing address records by provided string.
- findById() : CustomerAddress
- Method to find a customer address with a given ID it it exists else it will return null
- getAllAddresses() : array<string|int, mixed>
- Get all registered address records.
- getById() : CustomerAddress
- Method to get a customer address with a given ID
- getCustomerAddresses() : array<string|int, mixed>
- Gets all customer addresses
- getNewAddress() : CustomerAddress
- store() : CustomerAddressInterface
- Stores the customer address
Properties
$customerAddressDeleter
protected
CustomerAddressDeleterInterface
$customerAddressDeleter
$customerAddressReader
protected
CustomerAddressReaderInterface
$customerAddressReader
$customerAddressWriter
protected
CustomerAddressWriterInterface
$customerAddressWriter
$customerFactory
protected
AbstractCustomerFactory
$customerFactory
Methods
__construct()
Constructor of the class CustomerAddressRepository
public
__construct(CustomerAddressWriterInterface $customerAddressWriter, CustomerAddressDeleterInterface $customerAddressDeleter, CustomerAddressReaderInterface $customerAddressReader, AbstractCustomerFactory $customerFactory) : mixed
Parameters
- $customerAddressWriter : CustomerAddressWriterInterface
- $customerAddressDeleter : CustomerAddressDeleterInterface
- $customerAddressReader : CustomerAddressReaderInterface
- $customerFactory : AbstractCustomerFactory
Return values
mixed —deleteCustomerAddress()
Method to delete a customer address
public
deleteCustomerAddress(CustomerAddressInterface $address) : mixed
Parameters
- $address : CustomerAddressInterface
Return values
mixed —deleteCustomerAddressesByCustomer()
Deletes the customer address
public
deleteCustomerAddressesByCustomer(CustomerInterface $customer) : mixed
Parameters
- $customer : CustomerInterface
Return values
mixed —filterAddresses()
Filter existing address records by provided string.
public
filterAddresses(string $p_keyword[, Pager|null $pager = null ][, array<string|int, mixed> $sorters = [] ]) : array<string|int, mixed>
Parameters
- $p_keyword : string
- $pager : Pager|null = null
-
(Optional) Pager object with pagination information
- $sorters : array<string|int, mixed> = []
-
(Optional) array of Sorter objects with data sorting information
Return values
array<string|int, mixed> —Returns an array of CustomerAddress objects.
findById()
Method to find a customer address with a given ID it it exists else it will return null
public
findById(IdType $addressBookId) : CustomerAddress
Parameters
- $addressBookId : IdType
Return values
CustomerAddress —getAllAddresses()
Get all registered address records.
public
getAllAddresses([Pager|null $pager = null ][, array<string|int, mixed> $sorters = [] ]) : array<string|int, mixed>
Parameters
- $pager : Pager|null = null
-
(Optional) Pager object with pagination information
- $sorters : array<string|int, mixed> = []
-
(Optional) array of Sorter objects with data sorting information
Return values
array<string|int, mixed> —Returns an array of CustomerAddress objects.
getById()
Method to get a customer address with a given ID
public
getById(IdType $addressBookId) : CustomerAddress
Parameters
- $addressBookId : IdType
Return values
CustomerAddress —getCustomerAddresses()
Gets all customer addresses
public
getCustomerAddresses(CustomerInterface $customer) : array<string|int, mixed>
Parameters
- $customer : CustomerInterface
Return values
array<string|int, mixed> —of CustomerAddress objects
getNewAddress()
public
getNewAddress() : CustomerAddress
Return values
CustomerAddress —store()
Stores the customer address
public
store(CustomerAddressInterface $address) : CustomerAddressInterface
Parameters
- $address : CustomerAddressInterface