CustomerWriter

Implements \CustomerWriterInterface

Class CustomerWriter

This class is used for writing customer data to the database

category

System

package

Customer

implements

CustomerWriterInterface

Methods

Constructor of the class CustomerWriter.

__construct(\CI_DB_query_builder $dbQueryBuilder) 

Arguments

$dbQueryBuilder

\CI_DB_query_builder

Query builder.

Helper method to insert customer data into the database.

_insert(\CustomerInterface $customer) 
Throws
\InvalidArgumentException

If CIDB_query_builder::insert_id does not return an integer.

Arguments

$customer

\CustomerInterface

Customer.

Helper method to update customer data in the database.

_update(\CustomerInterface $customer) 

Arguments

$customer

\CustomerInterface

Customer.

TODO Use wrapper function getDefaultAddressId() instead of getDefaultAddress()->getId()

Writes customer data.

write(\CustomerInterface $customer) 

If customer does not exists it will perform an _insert(), otherwise it will perform an _update().

Arguments

$customer

\CustomerInterface

Customer.

Properties

Query builder.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder