OrderRepositoryWriter

Implements \OrderRepositoryWriterInterface

Class OrderRepositoryWriter

category

System

package

Order

subpackage

Repositories

Methods

OrderRepositoryWriter constructor

__construct(\CI_DB_query_builder $db) 

Arguments

$db

\CI_DB_query_builder

Query builder.

Serializes address block.

_serializeAddressBlock(\AddressBlockInterface $addressBlock, \StringType $prefix) : array

Arguments

$addressBlock

\AddressBlockInterface

The object to be serialized.

$prefix

\StringType

The address prefix can be one of the "delivery", "billing" and "customers".

Response

array

Array with the address data.

Converts the order to an associative array that is later used to insert/update the values into the database.

_serializeOrder(\OrderInterface $order) : array

Arguments

$order

\OrderInterface

The object to be serialized.

Response

array

Contains the orders object matched with their respective db columns.

Inserts a new order to the orders table.

insert(\OrderInterface $order) : integer

Arguments

$order

\OrderInterface

Order.

Response

integer

ID of inserted order.

Updates an existing order in the orders table.

update(\OrderInterface $order) : \OrderRepositoryWriter

Arguments

$order

\OrderInterface

Order object.

Response

\OrderRepositoryWriter

Same instance for method chaining.

Properties

Query builder.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder