OrdersSettings
extends Element
in package
Uses
ElementTrait
This is the order settings class.
The order settings will be stored in that class and will remain immutable (only get methods are available)
Tags
Table of Contents
$error | : Error|null | |
---|---|---|
__construct() | Elements constructor. | : mixed |
__toString() | Uses "json_encode" function to return the JSON format of the element. | : string |
getAddStockOnReturns() | Returns the order settings add stock on returns. | : bool |
getDesistanceDays() | Returns the numerical value specifying the maximum number of days allowed for a user to claim the right of withdrawal on an order or part of it. | : int |
getError() | Returns the current element error (if there is error). | : Error|null |
getFaresByShippingAddress() | Returns the order settings fares by shipping address. | : bool |
getForceBillingAddressCountry() | Returns the order settings force billing address country. | : bool |
getRecoverOrderDays() | Returns the order settings recover order days. | : int |
getRecurrentMinOrdersInPeriod() | Returns the order settings recurrent min orders in period. | : int |
getRecurrentOrdersPeriodDays() | Returns the order settings recurrent orders period days. | : int |
getReturnStates() | Returns the order settings return states. | : array<string|int, int> |
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> |
setError() | : void |
Properties
$error
protected
Error|null
$error
= null
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 —getAddStockOnReturns()
Returns the order settings add stock on returns.
public
getAddStockOnReturns() : bool
Return values
bool —getDesistanceDays()
Returns the numerical value specifying the maximum number of days allowed for a user to claim the right of withdrawal on an order or part of it.
public
getDesistanceDays() : int
.
Return values
int —getError()
Returns the current element error (if there is error).
public
getError() : Error|null
Return values
Error|null —getFaresByShippingAddress()
Returns the order settings fares by shipping address.
public
getFaresByShippingAddress() : bool
Return values
bool —getForceBillingAddressCountry()
Returns the order settings force billing address country.
public
getForceBillingAddressCountry() : bool
Return values
bool —getRecoverOrderDays()
Returns the order settings recover order days.
public
getRecoverOrderDays() : int
Return values
int —getRecurrentMinOrdersInPeriod()
Returns the order settings recurrent min orders in period.
public
getRecurrentMinOrdersInPeriod() : int
Return values
int —getRecurrentOrdersPeriodDays()
Returns the order settings recurrent orders period days.
public
getRecurrentOrdersPeriodDays() : int
Return values
int —getReturnStates()
Returns the order settings return states.
public
getReturnStates() : array<string|int, int>
Return values
array<string|int, int> —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> —setError()
protected
setError(mixed $error) : void
Parameters
- $error : mixed