dolibarr 20.0.2
ProductCombination2ValuePair Class Reference

Class ProductCombination2ValuePair Used to represent the relation between a variant and its attributes. More...

Public Member Functions

 __construct (DoliDB $db)
 Constructor.
 
 __toString ()
 Translates this class to a human-readable string.
 
 create ($user)
 Create a ProductCombination2ValuePair.
 
 fetchByFkCombination ($fk_combination)
 Retrieve all ProductCombination2ValuePair linked to a given ProductCombination ID.
 
 deleteByFkCombination ($fk_combination)
 Delete all ProductCombination2ValuePair linked to a given ProductCombination ID.
 

Detailed Description

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":
  • Another for "color: white":

Definition at line 41 of file ProductCombination2ValuePair.class.php.

Constructor & Destructor Documentation

◆ __construct()

ProductCombination2ValuePair::__construct ( DoliDB $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 93 of file ProductCombination2ValuePair.class.php.

Member Function Documentation

◆ __toString()

ProductCombination2ValuePair::__toString ( )

Translates this class to a human-readable string.

Returns
string

Definition at line 103 of file ProductCombination2ValuePair.class.php.

◆ create()

ProductCombination2ValuePair::create ( $user)

Create a ProductCombination2ValuePair.

Parameters
User$userUser that creates //not used
Returns
int Return 1 if OK, -1 if KO

Definition at line 123 of file ProductCombination2ValuePair.class.php.

◆ deleteByFkCombination()

ProductCombination2ValuePair::deleteByFkCombination ( $fk_combination)

Delete all ProductCombination2ValuePair linked to a given ProductCombination ID.

Parameters
int$fk_combinationID of the ProductCombination
Returns
int Return <0 if KO, 1 if OK

Definition at line 185 of file ProductCombination2ValuePair.class.php.

◆ fetchByFkCombination()

ProductCombination2ValuePair::fetchByFkCombination ( $fk_combination)

Retrieve all ProductCombination2ValuePair linked to a given ProductCombination ID.

Parameters
int$fk_combinationID of the ProductCombination
Returns
-1|ProductCombination2ValuePair[] Return <0 if KO, array of ProductCombination2ValuePair if OK

Definition at line 146 of file ProductCombination2ValuePair.class.php.


The documentation for this class was generated from the following file: