Copied!

ProductAvailabilityUpdateStruct

ProductAvailabilityUpdateStruct.php : 14
Extends ValueObject

The base class for all value objects and structs.

Supports read-only properties by marking them as protected. In this case they will only be writable using constructor, and need to be documented using @property-read <type> <$var> annotation in class doc in addition to inline property doc. Writable properties must be public and must be documented inline.

Methods

public__construct()

ProductAvailabilityUpdateStruct.php : 24

Construct object optionally with a set of properties.

public __construct(ProductInterface $product[, bool|null $availability = null ][, bool|null $isInfinite = null ][, int|null $stock = null ])

Readonly properties values must be set using $properties as they aren't 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 -

publiccreateInfinite()

ProductAvailabilityUpdateStruct.php : 78
public static createInfinite(ProductInterface $product[, bool|null $available = null ]) : self

Parameters

Name Type Default value Description
$product ProductInterface - -
$available bool|null null -

Return values

self

publiccreateWithStock()

ProductAvailabilityUpdateStruct.php : 73
public static createWithStock(ProductInterface $product, bool $available[, int|null $stock = null ]) : self

Parameters

Name Type Default value Description
$product ProductInterface - -
$available bool - -
$stock int|null null -

Return values

self

publicgetAvailability()

ProductAvailabilityUpdateStruct.php : 43
public getAvailability() : bool|null

Return values

bool|null

publicgetProduct()

ProductAvailabilityUpdateStruct.php : 38
public getProduct() : ProductInterface

Return values

ProductInterface

publicgetStock()

ProductAvailabilityUpdateStruct.php : 53
public getStock() : int|null

Return values

int|null

publicisInfinite()

ProductAvailabilityUpdateStruct.php : 63
public isInfinite() : bool|null

Return values

bool|null

publicsetAvailability()

ProductAvailabilityUpdateStruct.php : 48
public setAvailability(bool|null $availability) : void

Parameters

Name Type Default value Description
$availability bool|null - -

publicsetInfinite()

ProductAvailabilityUpdateStruct.php : 68
public setInfinite(bool|null $infinite) : void

Parameters

Name Type Default value Description
$infinite bool|null - -

publicsetStock()

ProductAvailabilityUpdateStruct.php : 58
public setStock(int|null $stock) : void

Parameters

Name Type Default value Description
$stock int|null - -

protectedgetProperties()

ValueObject.php : 54

Returns list of available properties' names.

protected getProperties([array<int, string> $dynamicProperties = [] ]) : array<int, string>

Override to add dynamic properties.

Parameters

Name Type Default value Description
$dynamicProperties array<int, string> []

Additional dynamic properties exposed on the object

Return values

array<int, string>

Tags
Serializerignore

()