ItemSet

Contracts

ItemSetRepositoryContract

The contract for the item set repository

Namespace

Plenty\Modules\ItemSet\Contracts

Methods

public show(int $id):ItemSet

Gets an item set. The item ID of the set must be specified.

Parameters
int $id The unique item ID of the set
public create(array $data):ItemSet

Creates an item set.

Parameters
array $data
public createSets(array $data):ItemSet

Creates item sets.

Parameters
array $data
public updateSets(array $data):array

Updates item sets.

Parameters
array $data
public update(int $id, array $data):ItemSet

Updates an item set. The item ID of the set must be specified.

Parameters
int $id The unique item ID of the set.
array $data
public deleteSets(array $data):DeleteResponse

Deletes item sets.

Parameters
array $data
public delete(int $id):DeleteResponse

Deletes an item set configuration. The ID must be specified.

Parameters
int $id
public all():array

Lists all item set configurations.

ItemSetConfigRepositoryContract

The contract for the item set configuration repository

Namespace

Plenty\Modules\ItemSet\Contracts

Methods

public show(int $id):ItemSetConfig

Gets an item set. The ID of the item set configuration must be specified.

Parameters
int $id The unique ID of the item set configuration
public create(array $data):ItemSetConfig

Creates an item set configuration.

Parameters
array $data
public update(int $id, array $data):ItemSetConfig

Updates an item set configuration. The ID of the item set configuration must be specified.

Parameters
int $id
array $data
public delete(int $id):DeleteResponse

Deletes an item set configuration. The ID of the item set configuration must be specified.

Parameters
int $id The unique ID of the item set configuration
public get(int $setId, int $setConfigId):ItemSetConfig

Gets the item set configuration of an item set.

Parameters
int $setId The unique item ID of the item set
int $setConfigId The unique ID of the item set configuration
public findBySetId(int $setId):ItemSetConfig

Gets the item set configuration of an item set. The item ID of the set item must be specified.

Parameters
int $setId The unique item ID of the item set

ItemSetComponentRepositoryContract

The contract for the item set component repository

Namespace

Plenty\Modules\ItemSet\Contracts

Methods

public show(int $id, array $with):ItemSetComponent

Gets an item set component. The ID of the item set component must be specified.

Parameters
int $id The unique ID of the item set component
array $with
public get(int $setId, int $id):ItemSetComponent

Gets an item set component. The item ID of the item set and the component ID must be specified.

Parameters
int $setId The unique item ID of the item set
int $id The unique ID of the item set component
public create(int $setConfigId, array $data):ItemSetComponent

Creates an item set component.

Parameters
int $setConfigId The unique ID of the item set configuration
array $data
public createComponents(int $setId, array $data):ItemSetComponent

Creates a link between an item and a set item and adds the item as a set component.

Parameters
int $setId The unique item ID of the item set
array $data
public updateComponents(int $setId, array $data):ItemSetComponent

Updates the item set components of a set item.

Parameters
int $setId The unique item ID of the item set
array $data
public update(int $setId, int $id, array $data):ItemSetComponent

Updates an item set component. The item ID of the set and the ID of the set component must be specified.

Parameters
int $setId The unique item ID of the item set
int $id The unique ID of the item set component
array $data
public deleteComponents(int $setId, array $data):DeleteResponse

Removes all item set components from an item set.

Parameters
int $setId The unique item ID of the item set
array $data
public delete(int $setId, int $id):DeleteResponse

Deletes the link between an item set component and an item set. The item ID of the set and the ID of the set component must be specified.

Parameters
int $setId The unique item ID of the item set
int $id The unique ID of the item set component
public all():array

Lists all item set components.

public findBySetId(int $setId, array $with):array

Lists the item set components of a set. The item ID of the item set must be specified.

Parameters
int $setId The unique item ID of the item set
array $with
public findByItemId(int $itemId):array

Lists the item set components of a set. The item ID of the item set component must be specified.

Parameters
int $itemId The unique item ID of the item set component

Models

ItemSetComponent

The ItemSetComponent model.

Namespace

Plenty\Modules\ItemSet\Models

Properties

Type Name Description
int id The item set component ID. The ID must be unique.
int setId The item ID of the item set. The ID must be unique.
int itemId The item ID of the set component
int quantity The number of copies of the component that are part of the set. Default quantity is 1.
bool isPurchasable Flag that indicates if enough stock is available for at least one variation of the component to cover the specified quantity.

Methods

public toArray()

Returns this model as an array.

ItemSet

The ItemSet model.

Namespace

Plenty\Modules\ItemSet\Models

Properties

Type Name Description
int id The item ID of the item set. The ID must be unique.
string name The name of the item set. The default language of the system is used.
array categories The array with categories of the item set. The category ID key "categoryId" must be specified. Example for JSON Object: "categories":[{"categoryId":"34"},{"categoryId":"35"}]}]

Methods

public toArray()

Returns this model as an array.

ItemSetConfig

The ItemSetConfig model.

Namespace

Plenty\Modules\ItemSet\Models

Properties

Type Name Description
int setId set id The item ID of the item set. The ID must be unique.
float rebate The discount in percent to be subtracted from the sum of the prices of the selected set components.
float minPrice The minimum price of the sum of all components; read only
float maxPrice the maximum price of the sum of all components; read only
int isPurchasable Flag that indicates if all components of the set have sufficient stock. Purchasability of a set depends on the component with the lowest stock.

Methods

public toArray()

Returns this model as an array.