dolibarr 21.0.0-alpha
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 42 of file ProductCombination2ValuePair.class.php.

Constructor & Destructor Documentation

◆ __construct()

ProductCombination2ValuePair::__construct ( DoliDB $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

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

Member Function Documentation

◆ __toString()

ProductCombination2ValuePair::__toString ( )

Translates this class to a human-readable string.

Returns
string

Definition at line 104 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 124 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<-1,-1>|int<1,1> -1 if KO, 1 if OK

Definition at line 186 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 147 of file ProductCombination2ValuePair.class.php.


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