public
|
#
__construct( CI_DB_query_builder $db )
InvoiceListGenerator constructor.
InvoiceListGenerator constructor.
Parameters
|
public
InvoiceListItemCollection
|
#
getInvoiceListByConditions( array $conditions = [], IntType $startIndex = null, IntType $maxCount = null, StringType $orderBy = null )
Returns an invoice list item collection by the given conditions.
The other arguments helps to control fetched data.
Returns an invoice list item collection by the given conditions.
The other arguments helps to control fetched data.
Parameters
- $conditions
- (Optional) Conditions for tht where clause.
- $startIndex
- (Optional) Start index for the limit clause.
- $maxCount
- (Optional) Max count for the limit clause.
- $orderBy
- (Optional) Sort order of fetched data.
Returns
Implementation of
|
public
InvoiceListItemCollection
|
#
filterInvoiceList( array $filterParameters, IntType $startIndex = null, IntType $maxCount = null, StringType $orderBy = null )
Filter invoice list items by the provided parameters.
Filter invoice list items by the provided parameters.
The following slug names need to be used:
- invoiceNumber => invoices.invoice_number - invoiceDate => invoices.invoice_date - sum => invoices.total_sum - customer => invoices.billing_firstname invoices.billing_lastname - group => invoices.customer_status_name - countryIsoCode => invoices.billing_country_iso_code_2 - orderNumber => invoices.order_id - orderDate => invoices.order_date_purchased - paymentMethod => invoices.payment_class - status => orders_status.orders_status_name
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
|
#
filterInvoiceListCount( array $filterParameters )
Get the filtered invoice count.
Get the filtered invoice 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
|
protected
InvoiceListItemCollection
|
#
_prepareCollection( array $resultArray )
Prepares the InvoiceListItemCollection by the passed result array.
Prepares the InvoiceListItemCollection by the passed result array.
Parameters
- $resultArray
- Result array with fetched invoice data.
Returns
|
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
Todo
Equal to OrderListGenerator::_createOrderAddressBlockByRow() method. Maybe outsource in abstract parent.
|
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
Todo
Equal to OrderListGenerator::_createMemoCollectionByCustomersId() method. Maybe outsource in abstract
parent.
|
protected
|
#
_select( )
Execute the select and join methods.
Execute the select and join methods.
Returns
$this|InvoiceListGenerator Returns the instance object for method chaining.
|
protected
string
|
#
_invoicesColumns( )
Returns a string for the ::_select() method which contains column names of the invoices table.
Returns a string for the ::_select() method which contains column names of the invoices table.
Returns
string
|
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
|
#
_limit( IntType $startIndex = null, IntType $maxCount = null )
Add limit configuration to the database object.
Add limit configuration to the database object.
Parameters
Returns
$this|InvoiceListGenerator Returns the instance object for method chaining.
Todo
Equal to OrderListGenerator::_limit() method. Maybe outsource in abstract parent.
|
protected
|
#
_order( StringType $orderBy = null )
Set the order by clause of the query.
Set the order by clause of the query.
Parameters
Returns
$this|InvoiceListGenerator Returns the instance object for method chaining.
Todo
Equal to OrderListGenerator::_order() method. Maybe outsource in abstract parent.
|
protected
InvoiceListGenerator
|
#
_group( )
Execute the group by statement.
Execute the group by statement.
Returns
|
protected
CI_DB_result
|
#
_filter( array $filterParameters, IntType $startIndex = null, IntType $maxCount = null, StringType $orderBy = null )
Filter the invoice records.
Filter the invoice 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
|
protected
OrderPaymentType
|
#
_createOrderType( $class, $method )
Creates and returns payment type instance by the given class and method argument.
Creates and returns payment type instance by the given class and method argument.
Parameters
- $class
- about the class type.
- $method
- about the method type.
Returns
Throws
InvalidArgumentException
|