RichDocumentItem
extends Element
in package
Uses
ElementTrait, EnumResolverTrait
This is the rich document item class.
The document will be stored in that class and will remain immutable (only get methods are available)
Tags
Table of Contents
$backOrder | : string | |
---|---|---|
$brandName | : string | |
$codes | : ProductCodes|null | |
$customTags | : array<string|int, mixed> | |
$discounts | : array<string|int, mixed> | |
$error | : Error|null | |
$hash | : string | |
$image | : string | |
$itemId | : int | |
$link | : string | |
$linkedParentId | : int | |
$name | : string | |
$noReturn | : bool | |
$offer | : bool | |
$onRequest | : bool | |
$onRequestAffected | : bool | |
$onRequestDays | : int | |
$options | : array<string|int, mixed> | |
$prices | : RichDocumentItemPrices|null | |
$quantity | : int | |
$reserve | : bool | |
$reverseChargeVat | : bool | |
$stockManagement | : bool | |
$stocks | : array<string|int, mixed> | |
$taxes | : array<string|int, mixed> | |
$type | : string | |
$weight | : float | |
__construct() | Elements constructor. | : mixed |
__toString() | Uses "json_encode" function to return the JSON format of the element. | : string |
getBackOrder() | Returns the rich document item backOrder. | : string |
getBrandName() | Returns the basket item brand name for the website current language. | : string |
getCodes() | Returns the rich document item codes. | : ProductCodes|null |
getCustomTags() | Returns the rich document item stocks. | : array<string|int, RichDocumentCustomTag> |
getDiscounts() | Returns the rich document item discounts. | : array<string|int, RichDocumentDiscount> |
getError() | Returns the current element error (if there is error). | : Error|null |
getHash() | Returns the rich document item hash. | : string |
getImage() | Returns the rich document item image. | : string |
getItemId() | Returns the rich document item itemId. | : int |
getLink() | Returns the rich document item link. | : string |
getLinkedParentId() | Returns the rich document item linked parent id. | : int |
getName() | Returns the rich document item name. | : string |
getNoReturn() | Returns the rich document item noReturn. | : bool |
getOffer() | Returns if the product row was buyed as an offer. | : bool |
getOnRequest() | Returns the rich document item onRequest. | : bool |
getOnRequestAffected() | Returns the rich document onRequestAffected. | : bool |
getOnRequestDays() | Returns the rich document item onRequestDays. | : int |
getOptions() | Returns the rich document item options. | : array<string|int, RichDocumentItemOption> |
getPrices() | Returns the rich document item prices. | : RichDocumentItemPrices|null |
getQuantity() | Returns the rich document item quantity. | : int |
getReserve() | Returns the rich document item reserve. | : bool |
getReverseChargeVat() | Returns the rich document item reverseChargeVat. | : bool |
getStockManagement() | Returns the rich document item stockManagement. | : bool |
getStocks() | Returns the rich document item stocks. | : array<string|int, RichDocumentItemStock> |
getTaxes() | Returns the rich document item taxes. | : array<string|int, RichDocumentElementTax> |
getType() | Returns the rich document item type. | : string |
getWeight() | Returns the rich document item weight. | : 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> |
setCodes() | : void | |
setCustomTags() | : void | |
setDiscounts() | : void | |
setError() | : void | |
setOptions() | : void | |
setPrices() | : void | |
setStocks() | : void | |
setTaxes() | : void |
Properties
$backOrder
protected
string
$backOrder
= ''
$brandName
protected
string
$brandName
= ''
$codes
protected
ProductCodes|null
$codes
= null
$customTags
protected
array<string|int, mixed>
$customTags
= []
$discounts
protected
array<string|int, mixed>
$discounts
= []
$error
protected
Error|null
$error
= null
$hash
protected
string
$hash
= ''
$image
protected
string
$image
= ''
$itemId
protected
int
$itemId
= 0
$link
protected
string
$link
= ''
$linkedParentId
protected
int
$linkedParentId
= 0
$name
protected
string
$name
= ''
$noReturn
protected
bool
$noReturn
= false
$offer
protected
bool
$offer
= false
$onRequest
protected
bool
$onRequest
= false
$onRequestAffected
protected
bool
$onRequestAffected
= false
$onRequestDays
protected
int
$onRequestDays
= 0
$options
protected
array<string|int, mixed>
$options
= []
$prices
protected
RichDocumentItemPrices|null
$prices
= null
$quantity
protected
int
$quantity
= 0
$reserve
protected
bool
$reserve
= false
$reverseChargeVat
protected
bool
$reverseChargeVat
= false
$stockManagement
protected
bool
$stockManagement
= false
$stocks
protected
array<string|int, mixed>
$stocks
= []
$taxes
protected
array<string|int, mixed>
$taxes
= []
$type
protected
string
$type
= ''
$weight
protected
float
$weight
= 0.0
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 —getBackOrder()
Returns the rich document item backOrder.
public
getBackOrder() : string
Return values
string —getBrandName()
Returns the basket item brand name for the website current language.
public
getBrandName() : string
Return values
string —getCodes()
Returns the rich document item codes.
public
getCodes() : ProductCodes|null
Return values
ProductCodes|null —getCustomTags()
Returns the rich document item stocks.
public
getCustomTags() : array<string|int, RichDocumentCustomTag>
Return values
array<string|int, RichDocumentCustomTag> —getDiscounts()
Returns the rich document item discounts.
public
getDiscounts() : array<string|int, RichDocumentDiscount>
Return values
array<string|int, RichDocumentDiscount> —getError()
Returns the current element error (if there is error).
public
getError() : Error|null
Return values
Error|null —getHash()
Returns the rich document item hash.
public
getHash() : string
Return values
string —getImage()
Returns the rich document item image.
public
getImage() : string
Return values
string —getItemId()
Returns the rich document item itemId.
public
getItemId() : int
Return values
int —getLink()
Returns the rich document item link.
public
getLink() : string
Return values
string —getLinkedParentId()
Returns the rich document item linked parent id.
public
getLinkedParentId() : int
Return values
int —getName()
Returns the rich document item name.
public
getName() : string
Return values
string —getNoReturn()
Returns the rich document item noReturn.
public
getNoReturn() : bool
Return values
bool —getOffer()
Returns if the product row was buyed as an offer.
public
getOffer() : bool
Return values
bool —getOnRequest()
Returns the rich document item onRequest.
public
getOnRequest() : bool
Return values
bool —getOnRequestAffected()
Returns the rich document onRequestAffected.
public
getOnRequestAffected() : bool
Return values
bool —getOnRequestDays()
Returns the rich document item onRequestDays.
public
getOnRequestDays() : int
Return values
int —getOptions()
Returns the rich document item options.
public
getOptions() : array<string|int, RichDocumentItemOption>
Return values
array<string|int, RichDocumentItemOption> —getPrices()
Returns the rich document item prices.
public
getPrices() : RichDocumentItemPrices|null
Return values
RichDocumentItemPrices|null —getQuantity()
Returns the rich document item quantity.
public
getQuantity() : int
Return values
int —getReserve()
Returns the rich document item reserve.
public
getReserve() : bool
Return values
bool —getReverseChargeVat()
Returns the rich document item reverseChargeVat.
public
getReverseChargeVat() : bool
Return values
bool —getStockManagement()
Returns the rich document item stockManagement.
public
getStockManagement() : bool
Return values
bool —getStocks()
Returns the rich document item stocks.
public
getStocks() : array<string|int, RichDocumentItemStock>
Return values
array<string|int, RichDocumentItemStock> —getTaxes()
Returns the rich document item taxes.
public
getTaxes() : array<string|int, RichDocumentElementTax>
Return values
array<string|int, RichDocumentElementTax> —getType()
Returns the rich document item type.
public
getType() : string
Return values
string —getWeight()
Returns the rich document item weight.
public
getWeight() : 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> —setCodes()
protected
setCodes(array<string|int, mixed> $codes) : void
Parameters
- $codes : 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 —setDiscounts()
protected
setDiscounts(array<string|int, mixed> $discounts) : void
Parameters
- $discounts : array<string|int, mixed>
Return values
void —setError()
protected
setError(mixed $error) : void
Parameters
- $error : mixed
Return values
void —setOptions()
protected
setOptions(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
Return values
void —setPrices()
protected
setPrices(array<string|int, mixed> $prices) : void
Parameters
- $prices : array<string|int, mixed>
Return values
void —setStocks()
protected
setStocks(array<string|int, mixed> $stocks) : void
Parameters
- $stocks : array<string|int, mixed>
Return values
void —setTaxes()
protected
setTaxes(array<string|int, mixed> $taxes) : void
Parameters
- $taxes : array<string|int, mixed>