public
|
#
__construct( CI_DB_query_builder $db )
OrderListGenerator Constructor
OrderListGenerator Constructor
Parameters
|
public
OrderListItemCollection
|
#
getOrderListByConditions( string|array $conditions = array(), IntType $startIndex = null, IntType $maxCount = null, StringType $orderBy = null )
Get Order List Items
Returns an order list item collection.
Parameters
- $conditions
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).
- $startIndex
- The start index of the wanted array to be returned (default = null).
- $maxCount
- Maximum amount of items which should be returned (default = null).
- $orderBy
- A string which defines how the items should be ordered (default = null).
Returns
Throws
InvalidArgumentException If the result rows contain invalid values.
Link
Implementation of
|
public
OrderListItemCollection
|
#
filterOrderList( array $filterParameters, IntType $startIndex = null, IntType $maxCount = null, StringType $orderBy = null )
Filter order list items by the provided parameters.
Filter order list items by the provided parameters.
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
Parameters
- $filterParameters
- Contains the column slug-names and their values.
- $startIndex
- The start index of the wanted array to be returned (default = null).
- $maxCount
- Maximum amount of items which should be returned (default = null).
- $orderBy
- A string which defines how the items should be ordered (default = null).
Returns
Throws
BadMethodCallException
InvalidArgumentException
Implementation of
|
public
integer
|
#
filterOrderListCount( array $filterParameters )
Get the filtered orders count.
Get the filtered orders count.
This number is useful for pagination functionality where the app needs to know the number of the filtered rows.
Parameters
Returns
integer
Throws
BadMethodCallException
Implementation of
|
public
mixed
|
#
getOrderListByKeyword( StringType $keyword, IntType $startIndex = null, IntType $maxCount = null, StringType $orderBy = null )
Filter records by a single keyword string.
Filter records by a single keyword string.
Parameters
- $keyword
- Keyword string to be used for searching in order records.
- $startIndex
- The start index of the wanted array to be returned (default = null).
- $maxCount
- Maximum amount of items which should be returned (default = null).
- $orderBy
- A string which defines how the items should be ordered (default = null).
Returns
mixed
Throws
InvalidArgumentException If the result rows contain invalid values.
Implementation of
|
protected
OrderListGenerator
|
#
_select( )
Execute the select and join methods.
Execute the select and join methods.
Returns
Throws
BadMethodCallException
|
protected
string
|
#
_ordersColumns( )
Returns a string for the ::_select() method which contains column names of the orders table.
Returns a string for the ::_select() method which contains column names of the orders table.
Returns
string
|
protected
string
|
#
_ordersStatusColumns( )
Returns a string for the ::_select() method which contains column names of the orders status table.
Returns a string for the ::_select() method which contains column names of the orders status table.
Returns
string
|
protected
string
|
#
_ordersTotalColumns( )
Returns a string for the ::_select() method which contains column names of the orders total table.
Returns a string for the ::_select() method which contains column names of the orders total table.
Returns
string
|
protected
string
|
#
_addressColumns( string $type )
Returns a string for the ::_select() method which contains column names of the orders table for address data.
Returns a string for the ::_select() method which contains column names of the orders table for address data.
Parameters
- $type
- Whether delivery or billing.
Returns
string
Throws
BadMethodCallException
|
protected
string
|
#
_customersStatusColumns( )
Returns a string for the ::_select() method which contains fallback customer status name if no value is
set in the orders table.
Returns a string for the ::_select() method which contains fallback customer status name if no value is
set in the orders table.
Returns
string
|
protected
string
|
#
_invoicesColumns( )
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.
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.
Returns
string
|
protected
OrderAddressBlock
|
#
_createOrderAddressBlockByRow( string $type, array $row )
Creates an order address block object by the given type and row_array (looped result of CIDB::result_array())
Creates an order address block object by the given type and row_array (looped result of CIDB::result_array())
Parameters
- $type
- Whether delivery or billing.
- $row
- Array which contain data about an order result row.
Returns
Throws
BadMethodCallException
|
protected
OrderListGenerator
|
#
_limit( IntType $startIndex = null, IntType $maxCount = null )
Add limit configuration to the database object.
Add limit configuration to the database object.
Parameters
Returns
|
protected
OrderListGenerator
|
#
_order( StringType $orderBy = null )
Set the order by clause of the query.
Set the order by clause of the query.
Parameters
Returns
|
protected
OrderListGenerator
|
#
_group( )
Execute the group by statement.
Execute the group by statement.
Returns
|
protected
OrderListItemCollection
|
#
_prepareCollection( array $result )
Prepare the OrderListItemCollection object.
Prepare the OrderListItemCollection object.
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
Parameters
- $result
- Contains the order data.
Returns
Throws
InvalidArgumentException
|
protected
OrderPaymentType
|
#
_createOrderPaymentType( array $row )
Creates and returns an order payment type instance by the given row data.
Creates and returns an order payment type instance by the given row data.
Parameters
- $row
- Row array with data about the order payment type.
Returns
|
protected
OrderShippingType
|
#
_createOrderShippingType( array $row )
Creates and returns an order shipping type instance by the given row data.
Creates and returns an order shipping type instance by the given row data.
Parameters
- $row
- Row array with data about the order shipping type.
Returns
|
protected
OrderShippingType |OrderPaymentType
|
#
_createOrderType( string $type, array $row )
Creates and returns whether an order shipping or payment type instance by the given row data and type argument.
Creates and returns whether an order shipping or payment type instance by the given row data and type argument.
Parameters
- $type
- Whether 'shipping' or 'payment', used to determine the expected order type class.
- $row
- Row array with data about the order type.
Returns
Throws
InvalidArgumentException
|
protected
CustomerMemoCollection
|
#
_createMemoCollectionByCustomersId( integer $customersId )
Creates and returns a customer memo collection by the given customers id.
Creates and returns a customer memo collection by the given customers id.
Parameters
- $customersId
- Id of customer.
Returns
|
protected
StringCollection
|
#
_createTrackingLinksByOrderId( integer $orderId )
Creates and returns a string collection which contains the tracking links of the order.
Creates and returns a string collection which contains the tracking links of the order.
Parameters
- $orderId
- Id of current order.
Returns
Throws
InvalidArgumentException
|
protected
IdCollection
|
#
_createWithdrawalIdsByOrderId( integer $orderId )
Creates and returns a ID collection which contains the withdrawal ids of the order.
Creates and returns a ID collection which contains the withdrawal ids of the order.
Parameters
- $orderId
- Id of current order.
Returns
Throws
InvalidArgumentException
|
protected
StringCollection
|
#
_createInvoiceNumberCollectionByOrderId( $orderId )
Creates and returns a string collection which contains the invoice numbers of the order
Creates and returns a string collection which contains the invoice numbers of the order
Parameters
- $orderId
- of current order
Returns
Throws
InvalidArgumentException
|
protected
CI_DB_result
|
#
_filter( array $filterParameters, IntType $startIndex = null, IntType $maxCount = null, StringType $orderBy = null )
Filter the order records.
Filter the order records.
This method contains the filtering logic. It can be overloaded in order to provide a custom filtering logic.
Parameters
- $filterParameters
- Contains the column slug-names and their values.
- $startIndex
- The start index of the wanted array to be returned (default = null).
- $maxCount
- Maximum amount of items which should be returned (default = null).
- $orderBy
- A string which defines how the items should be ordered (default = null).
Returns
CI_DB_result
Throws
BadMethodCallException
|