The base class for all value objects and structs.
Supports readonly properties by marking them as protected.
In this case they will only be writable using constructor, and need to be documented
using property-read
Methods¶
__construct() ¶
ProductAvailabilityUpdateStruct.php
:
24
Construct object optionally with a set of properties.
|
|
Readonly properties values must be set using $properties as they are not writable anymore after object has been created.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$product | ProductInterface | - | - |
$availability | bool|null | null | - |
$isInfinite | bool|null | null | - |
$stock | int|null | null | - |
createInfinite() ¶
ProductAvailabilityUpdateStruct.php
:
78
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$product | ProductInterface | - | - |
$available | bool|null | null | - |
Return values
self
createWithStock() ¶
ProductAvailabilityUpdateStruct.php
:
73
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$product | ProductInterface | - | - |
$available | bool | - | - |
$stock | int|null | null | - |
Return values
self
getAvailability() ¶
ProductAvailabilityUpdateStruct.php
:
43
|
|
Return values
bool|null
getProduct() ¶
ProductAvailabilityUpdateStruct.php
:
38
|
|
Return values
getStock() ¶
ProductAvailabilityUpdateStruct.php
:
53
|
|
Return values
int|null
isInfinite() ¶
ProductAvailabilityUpdateStruct.php
:
63
|
|
Return values
bool|null
setAvailability() ¶
ProductAvailabilityUpdateStruct.php
:
48
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$availability | bool|null | - | - |
setInfinite() ¶
ProductAvailabilityUpdateStruct.php
:
68
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$infinite | bool|null | - | - |
setStock() ¶
ProductAvailabilityUpdateStruct.php
:
58
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$stock | int|null | - | - |
getProperties() ¶
ValueObject.php
:
50
Function where list of properties are returned.
|
|
Used by attributes(), override to add dynamic properties
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$dynamicProperties | array<string|int, mixed> | [] |
Additional dynamic properties exposed on the object |
Return values
array<string|int, mixed>