Method |
Description |
|
createVariant ( string $name = '', string $description = '', integer | string $categoryId = null, integer | string $metricId = null ) : boolean | Model |
Creates a new variant instance, saves it,
and returns the resulting variant. |
|
getParent ( ) : Model |
Returns the parent item record
for the current variant. |
|
getTotalVariantStock ( boolean $recursive = true ) : integer | float |
Returns the total sum of the item
variants stock. This method is recursive
by default, and includes variants of variants
total stock. |
|
getVariants ( boolean $recursive = false ) : Illuminate\Database\Eloquent\Collection |
Returns all variants of the current item. |
|
hasVariants ( ) : boolean |
Returns true / false if the current
item has variants. |
|
isVariant ( ) : boolean |
Returns true / false if the current
item is a variant of another item. |
|
makeVariantOf ( Model $item ) |
Makes the current item a variant of
the specified item. |
|
newVariant ( string $name = '' ) : Model |
Returns a new Inventory model instance with it's parent
ID, category ID, and metric ID set to the current item's
for the creation of a variant. |
|
parent ( ) : BelongsTo |
The belongsTo parent relationship. |
|
variants ( ) : Illuminate\Database\Eloquent\Relations\HasMany |
The hasMany variants relationship. |
|
variantsRecursive ( ) : Illuminate\Database\Eloquent\Relations\HasMany |
The hasMany recursive variants relationship. |
|