phpDocumentor

InvoiceListGenerator
in package
implements InvoiceListGeneratorInterface

Class InvoiceListGenerator

Tags
category

System

Interfaces, Classes and Traits

InvoiceListGeneratorInterface
Interface InvoiceListGeneratorInterface

Table of Contents

$db  : CI_DB_query_builder
$defaultLanguageId  : int
$paymentTitleProvider  : PaymentTitleProvider
__construct()  : mixed
InvoiceListGenerator constructor.
filterInvoiceList()  : InvoiceListItemCollection
Filter invoice list items by the provided parameters.
filterInvoiceListCount()  : int
Get the filtered invoice count.
getInvoiceListByConditions()  : InvoiceListItemCollection
Returns an invoice list item collection by the given conditions.
_createMemoCollectionByCustomersId()  : CustomerMemoCollection
Creates and returns a customer memo collection by the given customers id.
_createOrderAddressBlockByRow()  : OrderAddressBlock
Creates an order address block object by the given type and row_array (looped result of CIDB::result_array())
_createOrderType()  : OrderPaymentType
Creates and returns payment type instance by the given class and method argument.
_filter()  : CI_DB_result
Filter the invoice records.
_group()  : InvoiceListGenerator
Execute the group by statement.
_invoicesColumns()  : string
Returns a string for the ::_select() method which contains column names of the invoices table.
_limit()  : $this|InvoiceListGenerator
Add limit configuration to the database object.
_order()  : $this|InvoiceListGenerator
Set the order by clause of the query.
_ordersColumns()  : string
Returns a string for the ::_select() method which contains column names of the orders table.
_ordersStatusColumns()  : string
Returns a string for the ::_select() method which contains column names of the orders_status table.
_prepareCollection()  : InvoiceListItemCollection
Prepares the InvoiceListItemCollection by the passed result array.
_select()  : $this|InvoiceListGenerator
Execute the select and join methods.

Properties

Methods

filterInvoiceList()

Filter invoice list items by the provided parameters.

public filterInvoiceList(array<string|int, mixed> $filterParameters[, IntType|null $startIndex = null ][, IntType|null $maxCount = null ][, StringType|null $orderBy = null ]) : InvoiceListItemCollection

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 : array<string|int, mixed>

Contains the column slug-names and their values.

$startIndex : IntType|null = null

The start index of the wanted array to be returned (default = null).

$maxCount : IntType|null = null

Maximum amount of items which should be returned (default = null).

$orderBy : StringType|null = null

A string which defines how the items should be ordered (default = null).

Tags
throws
BadMethodCallException
throws
InvalidArgumentException
Return values
InvoiceListItemCollection

filterInvoiceListCount()

Get the filtered invoice count.

public filterInvoiceListCount(array<string|int, mixed> $filterParameters) : int

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

Parameters
$filterParameters : array<string|int, mixed>
Tags
throws
BadMethodCallException
Return values
int

getInvoiceListByConditions()

Returns an invoice list item collection by the given conditions.

public getInvoiceListByConditions([array<string|int, mixed> $conditions = [] ][, IntType|null $startIndex = null ][, IntType|null $maxCount = null ][, StringType|null $orderBy = null ]) : InvoiceListItemCollection

The other arguments helps to control fetched data.

Parameters
$conditions : array<string|int, mixed> = []

(Optional) Conditions for tht where clause.

$startIndex : IntType|null = null

(Optional) Start index for the limit clause.

$maxCount : IntType|null = null

(Optional) Max count for the limit clause.

$orderBy : StringType|null = null

(Optional) Sort order of fetched data.

Return values
InvoiceListItemCollection

_createMemoCollectionByCustomersId()

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

protected _createMemoCollectionByCustomersId(int $customersId) : CustomerMemoCollection
Parameters
$customersId : int

Id of customer.

Tags
Todo

Equal to OrderListGenerator::_createMemoCollectionByCustomersId() method. Maybe outsource in abstract parent.

Return values
CustomerMemoCollection

_createOrderAddressBlockByRow()

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

protected _createOrderAddressBlockByRow(string $type, array<string|int, mixed> $row) : OrderAddressBlock
Parameters
$type : string

Whether delivery or billing.

$row : array<string|int, mixed>

Array which contain data about an order result row.

Tags
Todo

Equal to OrderListGenerator::_createOrderAddressBlockByRow() method. Maybe outsource in abstract parent.

Return values
OrderAddressBlock

_createOrderType()

Creates and returns payment type instance by the given class and method argument.

protected _createOrderType( $class,  $method) : OrderPaymentType
Parameters
$class :

data about the class type.

$method :

data about the method type.

Tags
throws
InvalidArgumentException
Return values
OrderPaymentType

_filter()

Filter the invoice records.

protected _filter(array<string|int, mixed> $filterParameters[, IntType|null $startIndex = null ][, IntType|null $maxCount = null ][, StringType|null $orderBy = null ]) : CI_DB_result

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

Parameters
$filterParameters : array<string|int, mixed>

Contains the column slug-names and their values.

$startIndex : IntType|null = null

The start index of the wanted array to be returned (default = null).

$maxCount : IntType|null = null

Maximum amount of items which should be returned (default = null).

$orderBy : StringType|null = null

A string which defines how the items should be ordered (default = null).

Tags
throws
BadMethodCallException
Return values
CI_DB_result

_invoicesColumns()

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

protected _invoicesColumns() : string
Return values
string

_ordersColumns()

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

protected _ordersColumns() : string
Return values
string

_ordersStatusColumns()

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

protected _ordersStatusColumns() : string
Return values
string

Search results