Product
extends DocumentRow
in package
Uses
ElementTrait, EnumResolverTrait
This is the product row class.
the product rows 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 | |
$id | Autonumeric element id. | : int |
$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 | : DocumentRowPrices|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 product row backorder mode. | : string |
getBrandName() | Returns the basket item brand name for the website current language. | : string |
getCodes() | Returns the product row codes. | : ProductCodes|null |
getCustomTags() | Returns the product row customTags. | : array<string|int, DocumentRowCustomTag> |
getDiscounts() | Returns the product row discounts. | : array<string|int, DocumentRowDiscount> |
getError() | Returns the current element error (if there is error). | : Error|null |
getHash() | Returns the document row hash. | : string |
getId() | Returns the element id. | : int |
getImage() | Returns the product row image. | : string |
getItemId() | Returns the document row product internal identifier. | : int |
getLink() | Returns the product row link. | : string |
getLinkedParentId() | Returns the product row linked parent Id. | : int |
getName() | Returns the element name on the website current language. | : string |
getNoReturn() | Returns the product row no return. | : bool |
getOffer() | Returns if the product row was buyed as an offer. | : bool |
getOnRequest() | Returns the product row on request. | : bool |
getOnRequestAffected() | Returns the document row on request affected. | : bool |
getOnRequestDays() | Returns the product row on request days. | : int |
getOptions() | Returns the product row options. | : array<string|int, DocumentRowOption> |
getPrices() | Returns the document row prices. | : DocumentRowPrices|null |
getQuantity() | Returns the document row quantity. | : int |
getReserve() | Returns the document row reserve. | : bool |
getReverseChargeVat() | Returns the product row reverse charge vat. | : bool |
getStockManagement() | Returns if the product row stock management was enabled. | : bool |
getStocks() | Returns the product row stocks. | : array<string|int, DocumentRowStock> |
getTaxes() | Returns the document row taxes. | : array<string|int, DocumentRowTax> |
getType() | Returns the document row type. | : string |
getWeight() | Returns the product row 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
= ''
$id
Autonumeric element id.
protected
int
$id
= 0
All the given elements by the LogiCommerce API will send it.
$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
DocumentRowPrices|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 product row backorder mode.
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 product row codes.
public
getCodes() : ProductCodes|null
Return values
ProductCodes|null —getCustomTags()
Returns the product row customTags.
public
getCustomTags() : array<string|int, DocumentRowCustomTag>
Return values
array<string|int, DocumentRowCustomTag> —getDiscounts()
Returns the product row discounts.
public
getDiscounts() : array<string|int, DocumentRowDiscount>
Return values
array<string|int, DocumentRowDiscount> —getError()
Returns the current element error (if there is error).
public
getError() : Error|null
Return values
Error|null —getHash()
Returns the document row hash.
public
getHash() : string
Return values
string —getId()
Returns the element id.
public
getId() : int
Return values
int —getImage()
Returns the product row image.
public
getImage() : string
Return values
string —getItemId()
Returns the document row product internal identifier.
public
getItemId() : int
Return values
int —getLink()
Returns the product row link.
public
getLink() : string
Return values
string —getLinkedParentId()
Returns the product row linked parent Id.
public
getLinkedParentId() : int
Return values
int —getName()
Returns the element name on the website current language.
public
getName() : string
Return values
string —getNoReturn()
Returns the product row no return.
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 product row on request.
public
getOnRequest() : bool
Return values
bool —getOnRequestAffected()
Returns the document row on request affected.
public
getOnRequestAffected() : bool
Return values
bool —getOnRequestDays()
Returns the product row on request days.
public
getOnRequestDays() : int
Return values
int —getOptions()
Returns the product row options.
public
getOptions() : array<string|int, DocumentRowOption>
Return values
array<string|int, DocumentRowOption> —getPrices()
Returns the document row prices.
public
getPrices() : DocumentRowPrices|null
Return values
DocumentRowPrices|null —getQuantity()
Returns the document row quantity.
public
getQuantity() : int
Return values
int —getReserve()
Returns the document row reserve.
public
getReserve() : bool
Return values
bool —getReverseChargeVat()
Returns the product row reverse charge vat.
public
getReverseChargeVat() : bool
Return values
bool —getStockManagement()
Returns if the product row stock management was enabled.
public
getStockManagement() : bool
Return values
bool —getStocks()
Returns the product row stocks.
public
getStocks() : array<string|int, DocumentRowStock>
Return values
array<string|int, DocumentRowStock> —getTaxes()
Returns the document row taxes.
public
getTaxes() : array<string|int, DocumentRowTax>
Return values
array<string|int, DocumentRowTax> —getType()
Returns the document row type.
public
getType() : string
Return values
string —getWeight()
Returns the product row 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>