Document
Document table trait
Table of Contents
Methods
- deleteItem() : bool
- Delete document item
- getDocumentItemsClass() : string|null
- Get document model class
- getExternal() : Model|null
- Get external document
- getItemsCount() : int
- Get document items count
- getSubTotal() : float
- Get document total
- getSubTotalAttribute() : float
- sub_total attribute
- getTotal() : float
- Get total document fees
- getTotalAttribute() : float
- total attribute
- getTotalFees() : float
- Get total document fees
- getTotalFeesAttribute() : float
- total_fees attribute
- hasExternal() : bool
- Return true if external document exists
- isEmpty() : bool
- Return true if document is empty
- items() : Relation|null
- Document items relation
- itemsToArray() : array<string|int, mixed>
- Items array
- saveItem() : object|null
- Save document item
- updateTotals() : bool
- Update document total
Methods
deleteItem()
Delete document item
public
deleteItem(string|int $id) : bool
Parameters
- $id : string|int
Return values
boolgetDocumentItemsClass()
Get document model class
public
getDocumentItemsClass() : string|null
Return values
string|nullgetExternal()
Get external document
public
getExternal(string $externalId, string $driverName) : Model|null
Parameters
- $externalId : string
- $driverName : string
Return values
Model|nullgetItemsCount()
Get document items count
public
getItemsCount() : int
Return values
intgetSubTotal()
Get document total
public
getSubTotal() : float
Return values
floatgetSubTotalAttribute()
sub_total attribute
public
getSubTotalAttribute() : float
Return values
floatgetTotal()
Get total document fees
public
getTotal() : float
Return values
floatgetTotalAttribute()
total attribute
public
getTotalAttribute() : float
Return values
floatgetTotalFees()
Get total document fees
public
getTotalFees() : float
Return values
floatgetTotalFeesAttribute()
total_fees attribute
public
getTotalFeesAttribute() : float
Return values
floathasExternal()
Return true if external document exists
public
hasExternal(string $externalId, string $driverName) : bool
Parameters
- $externalId : string
- $driverName : string
Return values
boolisEmpty()
Return true if document is empty
public
isEmpty() : bool
Return values
boolitems()
Document items relation
public
items() : Relation|null
Return values
Relation|nullitemsToArray()
Items array
public
itemsToArray() : array<string|int, mixed>
Return values
array<string|int, mixed>saveItem()
Save document item
public
saveItem(int $productId, array<string|int, mixed> $data) : object|null
Parameters
- $productId : int
- $data : array<string|int, mixed>
Return values
object|nullupdateTotals()
Update document total
public
updateTotals() : bool