OrderListGenerator

Extends \AbstractDataPaginator Implements \OrderListGeneratorInterface

Class OrderListGenerator

category

System

package

Order

Methods

ManufacturerReader constructor.

__construct(\CI_DB_query_builder $query_builder) 
inherited

Arguments

$query_builder

\CI_DB_query_builder

Returns a string for the ::_select() method which contains column names of the orders table for address data.

_addressColumns(string $type) : string
Throws
\BadMethodCallException

Arguments

$type

string

Whether delivery or billing.

Response

string

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.

Creates and returns a string collection which contains the invoice numbers of the order

_createInvoiceNumberCollectionByOrderId( $orderId) : \StringCollection
Throws
\InvalidArgumentException

Arguments

$orderId

Id of current order

Response

\StringCollection

Creates and returns a customer memo collection by the given customers id.

_createMemoCollectionByCustomersId(integer $customersId) : \CustomerMemoCollection

Arguments

$customersId

integer

Id of customer.

Response

\CustomerMemoCollection

Creates an order address block object by the given type and row_array (looped result of CIDB::result_array())

_createOrderAddressBlockByRow(string $type, array $row) : \OrderAddressBlock
Throws
\BadMethodCallException

Arguments

$type

string

Whether delivery or billing.

$row

array

Array which contain data about an order result row.

Response

\OrderAddressBlock

Creates and returns an order payment type instance by the given row data.

_createOrderPaymentType(array $row) : \OrderPaymentType

Arguments

$row

array

Row array with data about the order payment type.

Response

\OrderPaymentType

Creates and returns an order shipping type instance by the given row data.

_createOrderShippingType(array $row) : \OrderShippingType

Arguments

$row

array

Row array with data about the order shipping type.

Response

\OrderShippingType

Creates and returns whether an order shipping or payment type instance by the given row data and type argument.

_createOrderType(string $type, array $row) : \OrderShippingType|\OrderPaymentType
Throws
\InvalidArgumentException

Arguments

$type

string

Whether 'shipping' or 'payment', used to determine the expected order type class.

$row

array

Row array with data about the order type.

Response

\OrderShippingType|\OrderPaymentType

Creates and returns a string collection which contains the tracking links of the order.

_createTrackingLinksByOrderId(integer $orderId) : \StringCollection
Throws
\InvalidArgumentException

Arguments

$orderId

integer

Id of current order.

Response

\StringCollection

Creates and returns a ID collection which contains the withdrawal ids of the order.

_createWithdrawalIdsByOrderId(integer $orderId) : \IdCollection
Throws
\InvalidArgumentException

Arguments

$orderId

integer

Id of current order.

Response

\IdCollection

Returns a string for the ::_select() method which contains fallback customer status name if no value is set in the orders table.

_customersStatusColumns() : string

Response

string

_filter

_filter(array $filterParameters, \IntType|null $startIndex = null, \IntType|null $maxCount = null, \StringType $orderBy = null) : \CI_DB_result
deprecated

Filter the order records.

Arguments

$filterParameters

array

Contains the column slug-names and their values.

$startIndex

\IntType|null

(Optional) Pager object with pagination information

$maxCount

\IntType|null

(Optional) array of Sorter objects with data sorting information

$orderBy

\StringType

Response

\CI_DB_result

Filter the order records.

_filterWithPagerAndSorter(array $filterParameters, \Pager|null $pager = null, array $sorters = array()) : \CI_DB_result

Arguments

$filterParameters

array

Contains the column slug-names and their values.

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

\CI_DB_result

return the child class Field Map array.

_getFieldMap() : \array.
inherited abstract

Response

\array.

Returns the title of the given payment or shipping title.

_getPaymentOrShippingTitle(string $method, string $type) : string

Arguments

$method

string

Payment or shipping method.

$type

string

Whether "payment" or "shipping".

Response

string

Execute the group by statement.

_group() : \OrderListGenerator

Response

\OrderListGenerator

Returns the instance object for method chaining.

Returns a string for the ::_select() method which contains fallback implosion of all invoice IDs of the order if no value is set in the orders table.

_invoicesColumns() : string

Response

string

Set the order by clause of the query.

_order(\StringType $orderBy = null) : \OrderListGenerator

Arguments

$orderBy

\StringType

Response

\OrderListGenerator

Returns the instance object for method chaining.

Returns a string for the ::_select() method which contains column names of the orders table.

_ordersColumns() : string

Response

string

Returns a string for the ::_select() method which contains column names of the orders status table.

_ordersStatusColumns() : string

Response

string

Returns a string for the ::_select() method which contains column names of the orders total table.

_ordersTotalColumns() : string

Response

string

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'=>''].

Prepare the OrderListItemCollection object.

_prepareCollection(array $result) : \OrderListItemCollection

This method will prepare the collection object which is going to be returned by both the "get" and "filter" methods. The following values are required to be present in each row of the $result parameter:

 - orders_id
 - customers_id
 - customers_firstname
 - customers_lastname
 - date_purchased
 - payment_class
 - payment_method
 - shipping_class
 - shipping_method
 - orders_status_id
 - orders_status_name
 - total_sum
Throws
\InvalidArgumentException

Arguments

$result

array

Contains the order data.

Response

\OrderListItemCollection

Execute the select and join methods.

_select() : \OrderListGenerator
Throws
\BadMethodCallException

Response

\OrderListGenerator

Returns the instance object for method chaining.

Set the where clauses for the filtered order records query.

_setFilterArguments(array $filterParameters, \Pager|null $pager = null, array $sorters = array()) : \OrderListGeneratorInterface

This method contains the filtering logic. It can be overloaded in order to provide a custom filtering logic.

Throws
\BadMethodCallException

Arguments

$filterParameters

array

Contains the column slug-names and their values.

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

\OrderListGeneratorInterface

Same instance for chained method calls.

_setKeywordWhereClause

_setKeywordWhereClause(\StringType $keyword) 

Arguments

$keyword

\StringType

Keyword string to be used for searching in order records.

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 order list items by the provided parameters.

filterOrderList(array $filterParameters, \Pager|null $pager = null, array $sorters = array()) : \OrderListItemCollection

The following slug names need to be used:

  • number => orders.orders_id
  • customer => orders.customers_lastname orders.customers_firstname
  • group => orders.customers_status_name
  • sum => orders_total.value
  • payment => orders.payment_method
  • shipping => orders.shipping_method
  • countryIsoCode => orders.delivery_country_iso_code_2
  • date => orders.date_purchased
  • status => orders_status.orders_status_name
  • totalWeight => orders.order_total_weight
Throws
\BadMethodCallException
\InvalidArgumentException

Arguments

$filterParameters

array

Contains the column slug-names and their values.

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

\OrderListItemCollection

Get the filtered orders count.

filterOrderListCount(array $filterParameters) : integer

This number is useful for pagination functionality where the app needs to know the number of the filtered rows.

Throws
\BadMethodCallException

Arguments

$filterParameters

array

Response

integer

Get Order List Items

getOrderListByConditions(string|array $conditions = array(), \Pager|null $pager = null, array $sorters = array()) : \OrderListItemCollection

Returns an order list item collection.

link

http://www.codeigniter.com/user_guide/database/query_builder.html#looking-for-specific-data

Throws
\InvalidArgumentException

If the result rows contain invalid values.

Arguments

$conditions

string|array

Provide a WHERE clause string or an associative array (actually any parameter that is acceptable by the "where" method of the CI_DB_query_builder method).

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

\OrderListItemCollection

Filter records by a single keyword string.

getOrderListByKeyword(\StringType $keyword, \Pager|null $pager = null, array $sorters = array()) : mixed
Throws
\InvalidArgumentException

If the result rows contain invalid values.

Arguments

$keyword

\StringType

Keyword string to be used for searching in order records.

$pager

\Pager|null

(Optional) Pager object with pagination information

$sorters

array

(Optional) array of Sorter objects with data sorting information

Response

mixed

Get count of orders filtered by keyword

getOrderListByKeywordCount(\StringType $keyword) : integer

Arguments

$keyword

\StringType

Keyword string to be used for searching in order records.

Response

integer

Get the total count of all orders

getOrderListCount() : integer

Response

integer

Constants

FILTER_NO_VALUE

FILTER_NO_VALUE
var

Properties

db

db : \\CI_DB_query_builder
inherited
var

Type(s)

\\CI_DB_query_builder

defaultLanguageId

defaultLanguageId : integer
var

Type(s)

integer

paymentTitleProvider

paymentTitleProvider : \PaymentTitleProvider
var

Type(s)

\PaymentTitleProvider

shippingTitleProvider

shippingTitleProvider : \ShippingTitleProvider