ProductCombination2ValuePair
class ProductCombination2ValuePair (View source)
Class ProductCombination2ValuePair Used to represent the relation between a variant and its attributes.
Example: a product "shirt" has a variant "shirt XL white" linked to the attributes "size: XL" and "color: white". This is represented with two ProductCombination2ValuePair objects:
- One for "size: XL":
- $object->fk_prod_combination ID of the ProductCombination object between product "shirt" and its variant "shirt XL white"
- $object->fk_prod_attr ID of the ProductAttribute object "size"
- $object->fk_prod_attr_val ID of the ProductAttributeValue object "XL"
- Another for "color: white":
- $object->fk_prod_combination ID of the ProductCombination object between product "shirt" and its variant "shirt XL white"
- $object->fk_prod_attr ID of the ProductAttribute object "color"
- $object->fk_prod_attr_val ID of the ProductAttributeValue object "white"
Properties
| int | $id | ID of this ProductCombination2ValuePair |
|
| int | $fk_prod_combination | ID of the ProductCombination linked to this object (ex: ID of the ProductCombination between product "shirt" and its variant "shirt XL white") |
|
| int | $fk_prod_attr | ID of the ProductAttribute linked to this object (ex: ID of the ProductAttribute "color") |
|
| int | $fk_prod_attr_val | ID of the ProductAttributeValue linked to this object (ex: ID of the ProductAttributeValue "white") |
|
| string | $error | Error message |
|
| string[] | $errors | Array of error messages |
Methods
Translates this class to a human-readable string
Retrieve all ProductCombination2ValuePair linked to a given ProductCombination ID.
Delete all ProductCombination2ValuePair linked to a given ProductCombination ID.
Details
__construct(DoliDB $db)
Constructor
string
__toString()
Translates this class to a human-readable string
int
create(User $user)
Create a ProductCombination2ValuePair
-1|ProductCombination2ValuePair[]
fetchByFkCombination(int $fk_combination)
Retrieve all ProductCombination2ValuePair linked to a given ProductCombination ID.
int<-1, -1>|int<1, 1>
deleteByFkCombination(int $fk_combination)
Delete all ProductCombination2ValuePair linked to a given ProductCombination ID.