ProductOptionStock
in package
Class ProductOptionStock
Table of Contents
- STOCK_TYPE_ALWAYS_POSITIV = 'only-positive'
- STOCK_TYPE_MAY_BE_NEGATIVE = 'all-numbers'
- STOCK_TYPE_NOT_MANAGED = 'not-managed'
- ALLOWED_STOCK_TYPES = [self::STOCK_TYPE_ALWAYS_POSITIV, self::STOCK_TYPE_MAY_BE_NEGATIVE, self::STOCK_TYPE_NOT_MANAGED]
- HIGHEST_STORABLE_FLOAT = 99999999999.99989
- MAXIMUM_DECIMAL_PLACES = 4
- $stock : float
- $stockType : string
- create() : ProductOptionStock
- stock() : float
- stockType() : string
- __construct() : mixed
- ProductVariantStock constructor.
Constants
STOCK_TYPE_ALWAYS_POSITIV
public
mixed
STOCK_TYPE_ALWAYS_POSITIV
= 'only-positive'
STOCK_TYPE_MAY_BE_NEGATIVE
public
mixed
STOCK_TYPE_MAY_BE_NEGATIVE
= 'all-numbers'
STOCK_TYPE_NOT_MANAGED
public
mixed
STOCK_TYPE_NOT_MANAGED
= 'not-managed'
ALLOWED_STOCK_TYPES
private
mixed
ALLOWED_STOCK_TYPES
= [self::STOCK_TYPE_ALWAYS_POSITIV, self::STOCK_TYPE_MAY_BE_NEGATIVE, self::STOCK_TYPE_NOT_MANAGED]
HIGHEST_STORABLE_FLOAT
private
mixed
HIGHEST_STORABLE_FLOAT
= 99999999999.99989
MAXIMUM_DECIMAL_PLACES
private
mixed
MAXIMUM_DECIMAL_PLACES
= 4
Properties
$stock
private
float
$stock
$stockType
private
string
$stockType
Methods
create()
public
static create(float $stock[, string $stockType = ProductOptionStock::STOCK_TYPE_NOT_MANAGED ]) : ProductOptionStock
Parameters
- $stock : float
- $stockType : string = ProductOptionStock::STOCK_TYPE_NOT_MANAGED
Return values
ProductOptionStock —stock()
public
stock() : float
Return values
float —stockType()
public
stockType() : string
Return values
string —__construct()
ProductVariantStock constructor.
private
__construct(float $stock, string $stockType) : mixed
Parameters
- $stock : float
- $stockType : string