The contract for the item set repository
Plenty\Modules\ItemSet\Contracts
public show(int $id):ItemSet
Gets an item set. The item ID of the set must be specified.
int | $id | The unique item ID of the set |
public create(array $data):ItemSet
Creates an item set.
array | $data |
public createSets(array $data):ItemSet
Creates item sets.
array | $data |
public updateSets(array $data):array
Updates item sets.
array | $data |
public update(int $id, array $data):ItemSet
Updates an item set. The item ID of the set must be specified.
int | $id | The unique item ID of the set. |
array | $data |
public deleteSets(array $data):DeleteResponse
Deletes item sets.
array | $data |
public delete(int $id):DeleteResponse
Deletes an item set configuration. The ID must be specified.
int | $id |
public all():array
Lists all item set configurations.
The contract for the item set configuration repository
Plenty\Modules\ItemSet\Contracts
public show(int $id):ItemSetConfig
Gets an item set. The ID of the item set configuration must be specified.
int | $id | The unique ID of the item set configuration |
public create(array $data):ItemSetConfig
Creates an item set configuration.
array | $data |
public update(int $id, array $data):ItemSetConfig
Updates an item set configuration. The ID of the item set configuration must be specified.
int | $id | |
array | $data |
public delete(int $id):DeleteResponse
Deletes an item set configuration. The ID of the item set configuration must be specified.
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.
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.
int | $setId | The unique item ID of the item set |
The contract for the item set component repository
Plenty\Modules\ItemSet\Contracts
public show(int $id, array $with):ItemSetComponent
Gets an item set component. The ID of the item set component must be specified.
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.
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.
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.
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.
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.
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.
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.
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.
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.
int | $itemId | The unique item ID of the item set component |
public deleteOne(int $setConfigId, int $itemId):DeleteResponse
Delete an item set component. The item ID of the item set component and the set config ID must be specified.
int | $setConfigId | |
int | $itemId |
The ItemSetComponent model.
Plenty\Modules\ItemSet\Models
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. |
public toArray()
Returns this model as an array.
The ItemSet model.
Plenty\Modules\ItemSet\Models
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"}]}] |
public toArray()
Returns this model as an array.
The ItemSetConfig model.
Plenty\Modules\ItemSet\Models
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. |
public toArray()
Returns this model as an array.