Shipment
extends BaseShipment
in package
Uses
ElementTrait
This is the shipment class.
The shipments information will be stored in that class and will remain immutable (only get methods are available)
Tags
Table of Contents
$destinationZone | : GeographicalZone|null | |
---|---|---|
$error | : Error|null | |
$hash | : string | |
$originWarehouseGroupId | : int | |
$rows | : array<string|int, mixed> | |
$shippingCalculation | : string | |
__construct() | Elements constructor. | : mixed |
__toString() | Uses "json_encode" function to return the JSON format of the element. | : string |
getAppliedDiscounts() | Returns the shipment applied discounts. | : array<string|int, AppliedDiscount> |
getDestinationZone() | Returns the shipment destination zone. | : GeographicalZone|null |
getError() | Returns the current element error (if there is error). | : Error|null |
getHash() | Returns the shipment hash. | : string |
getOffsetDays() | Returns the shipment offset days. | : int |
getOriginWarehouseGroupId() | Returns the shipment origin warehouse group internal id. | : int |
getRows() | Returns the shipment rows. | : array<string|int, ShipmentRow> |
getShippingCalculation() | Returns the shipment shipping calculation. | : string |
getShippings() | Returns the shipment shippings. | : array<string|int, Shipping> |
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> |
setDestinationZone() | : void | |
setError() | : void | |
setRows() | : void |
Properties
$destinationZone
protected
GeographicalZone|null
$destinationZone
= null
$error
protected
Error|null
$error
= null
$hash
protected
string
$hash
= ''
$originWarehouseGroupId
protected
int
$originWarehouseGroupId
= 0
$rows
protected
array<string|int, mixed>
$rows
= []
$shippingCalculation
protected
string
$shippingCalculation
= ''
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 —getAppliedDiscounts()
Returns the shipment applied discounts.
public
getAppliedDiscounts() : array<string|int, AppliedDiscount>
Return values
array<string|int, AppliedDiscount> —getDestinationZone()
Returns the shipment destination zone.
public
getDestinationZone() : GeographicalZone|null
Return values
GeographicalZone|null —getError()
Returns the current element error (if there is error).
public
getError() : Error|null
Return values
Error|null —getHash()
Returns the shipment hash.
public
getHash() : string
Return values
string —getOffsetDays()
Returns the shipment offset days.
public
getOffsetDays() : int
Return values
int —getOriginWarehouseGroupId()
Returns the shipment origin warehouse group internal id.
public
getOriginWarehouseGroupId() : int
Return values
int —getRows()
Returns the shipment rows.
public
getRows() : array<string|int, ShipmentRow>
Return values
array<string|int, ShipmentRow> —getShippingCalculation()
Returns the shipment shipping calculation.
public
getShippingCalculation() : string
Return values
string —getShippings()
Returns the shipment shippings.
public
getShippings() : array<string|int, Shipping>
Return values
array<string|int, Shipping> —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> —setDestinationZone()
protected
setDestinationZone(array<string|int, mixed> $destinationZone) : void
Parameters
- $destinationZone : array<string|int, mixed>
Return values
void —setError()
protected
setError(mixed $error) : void
Parameters
- $error : mixed
Return values
void —setRows()
protected
setRows(array<string|int, mixed> $rows) : void
Parameters
- $rows : array<string|int, mixed>