Метод | Описание | |
---|---|---|
createVariant ( string $name = '', string $description = '', integer | string $categoryId = null, integer | string $metricId = null ) : boolean | |
Creates a new variant instance, saves it, and returns the resulting variant. | |
getParent ( ) : |
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 ( |
Makes the current item a variant of the specified item. | |
newVariant ( string $name = '' ) : |
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 ( ) : |
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. |
Метод | Описание | |
---|---|---|
processMakeVariant ( integer | string $itemId ) | Processes making the current item a variant of the specified item ID. |
public createVariant ( string $name = '', string $description = '', integer | string $categoryId = null, integer | string $metricId = null ) : boolean | |
||
$name | string | |
$description | string | |
$categoryId | integer | string | |
$metricId | integer | string | |
Результат | boolean | |
public getParent ( ) : |
||
Результат |
public getVariants ( boolean $recursive = false ) : Illuminate\Database\Eloquent\Collection | ||
$recursive | boolean | |
Результат | Illuminate\Database\Eloquent\Collection |
public hasVariants ( ) : boolean | ||
Результат | boolean |
public makeVariantOf ( |
||
$item |
public newVariant ( string $name = '' ) : |
||
$name | string | |
Результат |
public parent ( ) : |
||
Результат |
protected processMakeVariant ( integer | string $itemId ) | ||
$itemId | integer | string |
public variants ( ) : Illuminate\Database\Eloquent\Relations\HasMany | ||
Результат | Illuminate\Database\Eloquent\Relations\HasMany |
public variantsRecursive ( ) : Illuminate\Database\Eloquent\Relations\HasMany | ||
Результат | Illuminate\Database\Eloquent\Relations\HasMany |