AbstractDocumentBase
extends Element
in package
Uses
ElementTrait, IdentifiableElementTrait, IntegrableElementTrait
This is the document class.
The document will be stored in that class and will remain immutable (only get methods are available)
Tags
Table of Contents
$comment | : string | |
---|---|---|
$currencies | : array<string|int, mixed> | |
$customTags | : array<string|int, mixed> | |
$date | : Date|null | |
$delivery | : DocumentDelivery|null | |
$deliveryDate | : Date|null | |
$documentNumber | : string | |
$error | : Error|null | |
$headquarter | : DocumentHeadquarter|null | |
$id | Autonumeric element id. | : int |
$information | : DocumentInformation|null | |
$items | : array<string|int, mixed> | |
$languageCode | : string | |
$paid | : bool | |
$paymentDate | : Date|null | |
$pId | Public and readable element id. | : string |
$reserve | : bool | |
$reverseChargeVat | : bool | |
$rewardPoints | : array<string|int, mixed> | |
$taxes | : array<string|int, mixed> | |
$total | : float | |
$totals | : DocumentTotal|null | |
$user | : DocumentUser|null | |
$vouchers | : array<string|int, mixed> | |
__construct() | Elements constructor. | : mixed |
__toString() | Uses "json_encode" function to return the JSON format of the element. | : string |
getComment() | Returns the document comment. | : string |
getCurrencies() | Returns the document currencies. | : array<string|int, DocumentCurrency> |
getCustomTags() | Returns the document custom tags. | : array<string|int, DocumentCustomTag> |
getDate() | Returns the document date. | : Date|null |
getDelivery() | Returns the document Delivery. | : DocumentDelivery |
getDeliveryDate() | Returns the document delivery date. | : Date|null |
getDocumentNumber() | Returns the document documentNumber. | : string |
getError() | Returns the current element error (if there is error). | : Error|null |
getHeadquarter() | Returns the document information. | : DocumentHeadquarter|null |
getId() | Returns the element id. | : int |
getInformation() | Returns the document information. | : DocumentInformation|null |
getItems() | Returns the document items. | : array<string|int, DocumentRow> |
getLanguageCode() | Returns the document language initials. | : string |
getPaid() | Returns if the document is paid or not. | : bool |
getPaymentDate() | Returns the document payment date. | : Date|null |
getPId() | Returns the element public id (pId). | : string |
getReserve() | Returns if the document is in a reserve status or not. | : bool |
getReverseChargeVat() | Sets if the document applies the reverse charge vat or not. | : bool |
getRewardPoints() | Returns the document reward points. | : array<string|int, DocumentRewardPoints> |
getTaxes() | Returns the document taxes. | : array<string|int, DocumentTax> |
getTotal() | Returns the document total. | : float |
getTotals() | Returns the document totals. | : DocumentTotal|null |
getUser() | Returns the document user. | : DocumentUser|null |
getVouchers() | Returns the document vouchers. | : array<string|int, DocumentVoucher> |
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> |
setCurrencies() | : void | |
setCustomTags() | : void | |
setDate() | : void | |
setDelivery() | : void | |
setDeliveryDate() | : void | |
setError() | : void | |
setHeadquarter() | : void | |
setInformation() | : void | |
setItems() | : void | |
setPaymentDate() | : void | |
setRewardPoints() | : void | |
setTaxes() | : void | |
setTotals() | : void | |
setUser() | : void | |
setVouchers() | : void |
Properties
$comment
protected
string
$comment
= ''
$currencies
protected
array<string|int, mixed>
$currencies
= []
$customTags
protected
array<string|int, mixed>
$customTags
= []
$date
protected
Date|null
$date
= null
$delivery
protected
DocumentDelivery|null
$delivery
= null
$deliveryDate
protected
Date|null
$deliveryDate
= null
$documentNumber
protected
string
$documentNumber
= ''
$error
protected
Error|null
$error
= null
$headquarter
protected
DocumentHeadquarter|null
$headquarter
= null
$id
Autonumeric element id.
protected
int
$id
= 0
All the given elements by the LogiCommerce API will send it.
$information
protected
DocumentInformation|null
$information
= null
$items
protected
array<string|int, mixed>
$items
= []
$languageCode
protected
string
$languageCode
= ''
$paid
protected
bool
$paid
= false
$paymentDate
protected
Date|null
$paymentDate
= null
$pId
Public and readable element id.
protected
string
$pId
= ''
Setted by the user on LogiCommerce. All the integrable elements by the LogiCommerce API will send it. Useful for integrations and other 3rd party softwares that need to connect to LogiCommerce software.
$reserve
protected
bool
$reserve
= false
$reverseChargeVat
protected
bool
$reverseChargeVat
= false
$rewardPoints
protected
array<string|int, mixed>
$rewardPoints
= []
$taxes
protected
array<string|int, mixed>
$taxes
= []
$total
protected
float
$total
= 0.0
$totals
protected
DocumentTotal|null
$totals
= null
$user
protected
DocumentUser|null
$user
= null
$vouchers
protected
array<string|int, mixed>
$vouchers
= []
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 —getComment()
Returns the document comment.
public
getComment() : string
Return values
string —getCurrencies()
Returns the document currencies.
public
getCurrencies() : array<string|int, DocumentCurrency>
Return values
array<string|int, DocumentCurrency> —getCustomTags()
Returns the document custom tags.
public
getCustomTags() : array<string|int, DocumentCustomTag>
Return values
array<string|int, DocumentCustomTag> —getDate()
Returns the document date.
public
getDate() : Date|null
Return values
Date|null —getDelivery()
Returns the document Delivery.
public
getDelivery() : DocumentDelivery
Return values
DocumentDelivery —getDeliveryDate()
Returns the document delivery date.
public
getDeliveryDate() : Date|null
Return values
Date|null —getDocumentNumber()
Returns the document documentNumber.
public
getDocumentNumber() : string
Return values
string —getError()
Returns the current element error (if there is error).
public
getError() : Error|null
Return values
Error|null —getHeadquarter()
Returns the document information.
public
getHeadquarter() : DocumentHeadquarter|null
Return values
DocumentHeadquarter|null —getId()
Returns the element id.
public
getId() : int
Return values
int —getInformation()
Returns the document information.
public
getInformation() : DocumentInformation|null
Return values
DocumentInformation|null —getItems()
Returns the document items.
public
getItems() : array<string|int, DocumentRow>
Return values
array<string|int, DocumentRow> —getLanguageCode()
Returns the document language initials.
public
getLanguageCode() : string
Return values
string —getPaid()
Returns if the document is paid or not.
public
getPaid() : bool
Return values
bool —getPaymentDate()
Returns the document payment date.
public
getPaymentDate() : Date|null
Return values
Date|null —getPId()
Returns the element public id (pId).
public
getPId() : string
Return values
string —getReserve()
Returns if the document is in a reserve status or not.
public
getReserve() : bool
Return values
bool —getReverseChargeVat()
Sets if the document applies the reverse charge vat or not.
public
getReverseChargeVat() : bool
Return values
bool —getRewardPoints()
Returns the document reward points.
public
getRewardPoints() : array<string|int, DocumentRewardPoints>
Return values
array<string|int, DocumentRewardPoints> —getTaxes()
Returns the document taxes.
public
getTaxes() : array<string|int, DocumentTax>
Return values
array<string|int, DocumentTax> —getTotal()
Returns the document total.
public
getTotal() : float
Return values
float —getTotals()
Returns the document totals.
public
getTotals() : DocumentTotal|null
Return values
DocumentTotal|null —getUser()
Returns the document user.
public
getUser() : DocumentUser|null
Return values
DocumentUser|null —getVouchers()
Returns the document vouchers.
public
getVouchers() : array<string|int, DocumentVoucher>
Return values
array<string|int, DocumentVoucher> —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> —setCurrencies()
protected
setCurrencies(array<string|int, mixed> $currencies) : void
Parameters
- $currencies : array<string|int, mixed>
Return values
void —setCustomTags()
protected
setCustomTags(array<string|int, mixed> $customTags) : void
Parameters
- $customTags : array<string|int, mixed>
Return values
void —setDate()
protected
setDate(string $date) : void
Parameters
- $date : string
Return values
void —setDelivery()
protected
setDelivery(array<string|int, mixed> $delivery) : void
Parameters
- $delivery : array<string|int, mixed>
Return values
void —setDeliveryDate()
protected
setDeliveryDate(string $deliveryDate) : void
Parameters
- $deliveryDate : string
Return values
void —setError()
protected
setError(mixed $error) : void
Parameters
- $error : mixed
Return values
void —setHeadquarter()
protected
setHeadquarter(array<string|int, mixed> $headquarter) : void
Parameters
- $headquarter : array<string|int, mixed>
Return values
void —setInformation()
protected
setInformation(array<string|int, mixed> $information) : void
Parameters
- $information : array<string|int, mixed>
Return values
void —setItems()
protected
setItems(array<string|int, mixed> $items) : void
Parameters
- $items : array<string|int, mixed>
Return values
void —setPaymentDate()
protected
setPaymentDate(string $paymentDate) : void
Parameters
- $paymentDate : string
Return values
void —setRewardPoints()
protected
setRewardPoints(array<string|int, mixed> $rewardPoints) : void
Parameters
- $rewardPoints : array<string|int, mixed>
Return values
void —setTaxes()
protected
setTaxes(array<string|int, mixed> $taxes) : void
Parameters
- $taxes : array<string|int, mixed>
Return values
void —setTotals()
protected
setTotals(array<string|int, mixed> $totals) : void
Parameters
- $totals : array<string|int, mixed>
Return values
void —setUser()
protected
setUser(array<string|int, mixed> $user) : void
Parameters
- $user : array<string|int, mixed>
Return values
void —setVouchers()
protected
setVouchers(array<string|int, mixed> $vouchers) : void
Parameters
- $vouchers : array<string|int, mixed>