DocumentTotal extends Element
in package
Uses ElementTrait, IdentifiableElementTrait, TotalsTrait

This is the document applied tax class.

The document applied taxes will be stored in that class and will remain immutable (only get methods are available)

Tags
see
DocumentTotal::getSubtotalRows()
see
DocumentTotal::getTotalRows()
see
DocumentTotal::getSubtotalShippings()
see
DocumentTotal::getTotalShippings()
see
DocumentTotal::getSubtotalPaymentSystem()
see
DocumentTotal::getTotalPaymentSystem()
see
DocumentTotal::getSubtotal()
see
DocumentTotal::getTotalRowsDiscounts()
see
DocumentTotal::getTotalBasketDiscounts()
see
DocumentTotal::getTotalShippingDiscounts()
see
Element
see
ElementTrait
see
IdentifiableElementTrait
see
TotalsTrait

Table of Contents

$error  : Error|null
$id Autonumeric element id.  : int
__construct() Elements constructor.  : mixed
__toString() Uses "json_encode" function to return the JSON format of the element.  : string
getError() Returns the current element error (if there is error).  : Error|null
getId() Returns the element id.  : int
getSubtotal() Returns the document subtotal.  : float
getSubtotalPaymentSystem() Returns the document subtotal for payment system.  : float
getSubtotalRows() Returns the document subtotal for rows.  : float
getSubtotalShippings() Returns the document subtotal for shippings.  : float
getTotal() Returns the basket total.  : float
getTotalBasketDiscounts() Returns the document total for basket discounts.  : float
getTotalDiscounts() Returns the basket discounts total.  : float
getTotalPaymentSystem() Returns the document total for payment system.  : float
getTotalRows() Returns the document total for rows.  : float
getTotalRowsDiscounts() Returns the document total for rows discounts.  : float
getTotalShippingDiscounts() Returns the document total for shipping discounts.  : float
getTotalShippings() Returns the document total for shippings.  : float
getTotalTaxes() Returns the basket taxes total.  : float
getTotalVouchers() Returns the basket vouchers total.  : float
jsonSerialize() Allow elements to be serialized.  : array<string|int, mixed>
toArray() Used to allow elements to be serialized.  : array<string|int, mixed>
getFieldItem()  : object|null
getFormattedData()  : mixed
setArrayField() Convert an API array of objects to a PHP array of objects.  : array<string|int, mixed>
setError()  : void

Properties

$id

Autonumeric element id.

protected int $id = 0

All the given elements by the LogiCommerce API will send it.

Methods

__construct()

Elements constructor.

public __construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
$data : array<string|int, mixed> = []

Array that contains all the values to the object to initialize

Return values
mixed

__toString()

Uses "json_encode" function to return the JSON format of the element.

public __toString() : string

Auto-invoked using echo or concatenations.

Return values
string

getError()

Returns the current element error (if there is error).

public getError() : Error|null
Return values
Error|null

getSubtotal()

Returns the document subtotal.

public getSubtotal() : float
Return values
float

getSubtotalPaymentSystem()

Returns the document subtotal for payment system.

public getSubtotalPaymentSystem() : float
Return values
float

getSubtotalRows()

Returns the document subtotal for rows.

public getSubtotalRows() : float
Return values
float

getSubtotalShippings()

Returns the document subtotal for shippings.

public getSubtotalShippings() : float
Return values
float

getTotal()

Returns the basket total.

public getTotal() : float
Return values
float

getTotalBasketDiscounts()

Returns the document total for basket discounts.

public getTotalBasketDiscounts() : float
Return values
float

getTotalDiscounts()

Returns the basket discounts total.

public getTotalDiscounts() : float
Return values
float

getTotalPaymentSystem()

Returns the document total for payment system.

public getTotalPaymentSystem() : float
Return values
float

getTotalRows()

Returns the document total for rows.

public getTotalRows() : float
Return values
float

getTotalRowsDiscounts()

Returns the document total for rows discounts.

public getTotalRowsDiscounts() : float
Return values
float

getTotalShippingDiscounts()

Returns the document total for shipping discounts.

public getTotalShippingDiscounts() : float
Return values
float

getTotalShippings()

Returns the document total for shippings.

public getTotalShippings() : float
Return values
float

getTotalTaxes()

Returns the basket taxes total.

public getTotalTaxes() : float
Return values
float

getTotalVouchers()

Returns the basket vouchers total.

public getTotalVouchers() : float
Return values
float

jsonSerialize()

Allow elements to be serialized.

public jsonSerialize() : array<string|int, mixed>

Auto-invoked using "json_encode" function.

Return values
array<string|int, mixed>

toArray()

Used to allow elements to be serialized.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFieldItem()

protected getFieldItem(array<string|int, mixed> $item, string $class) : object|null
Parameters
$item : array<string|int, mixed>
$class : string
Return values
object|null

getFormattedData()

protected getFormattedData(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

setArrayField()

Convert an API array of objects to a PHP array of objects.

protected setArrayField(array<string|int, mixed> $data, string $class) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

Array that contains all the values to the objects to initialize

$class : string

The PHP class we want the objects to be

Return values
array<string|int, mixed>

setError()

protected setError(mixed $error) : void
Parameters
$error : mixed
Return values
void

Search results