dolibarr 21.0.0-beta
|
Class to parse product price expressions. More...
Public Member Functions | |
__construct ($db) | |
Constructor. | |
translatedError () | |
Returns translated error. | |
parseExpression ($product, $expression, $values) | |
Calculates price based on expression. | |
parseProduct ($product, $extra_values=array()) | |
Calculates product price based on product id and associated expression. | |
parseProductSupplier ($product_supplier, $extra_values=array()) | |
Calculates supplier product price based on product supplier price and associated expression. | |
testExpression ($product_id, $expression, $extra_values=array()) | |
Tests string expression for validity. | |
Class to parse product price expressions.
Definition at line 34 of file price_parser.class.php.
PriceParser::__construct | ( | $db | ) |
Constructor.
Definition at line 66 of file price_parser.class.php.
PriceParser::parseExpression | ( | $product, | |
$expression, | |||
$values ) |
Calculates price based on expression.
Product | $product | The Product object to get information |
string | $expression | The expression to parse |
array<string,mixed> | $values Strings to replace |
Definition at line 138 of file price_parser.class.php.
References dol_now().
Referenced by parseProduct(), parseProductSupplier(), and testExpression().
PriceParser::parseProduct | ( | $product, | |
$extra_values = array() ) |
Calculates product price based on product id and associated expression.
Product | $product | The Product object to get information |
array<string,mixed> | $extra_values Any additional values for expression |
Definition at line 266 of file price_parser.class.php.
References parseExpression().
PriceParser::parseProductSupplier | ( | $product_supplier, | |
$extra_values = array() ) |
Calculates supplier product price based on product supplier price and associated expression.
ProductFournisseur | $product_supplier | The Product supplier object to get information |
array<string,mixed> | $extra_values Any additional values for expression |
Definition at line 313 of file price_parser.class.php.
References parseExpression().
PriceParser::testExpression | ( | $product_id, | |
$expression, | |||
$extra_values = array() ) |
Tests string expression for validity.
int | $product_id | The Product id to get information |
string | $expression | The expression to parse |
array<string,mixed> | $extra_values Any additional values for expression |
Definition at line 344 of file price_parser.class.php.
References parseExpression().
PriceParser::translatedError | ( | ) |
Returns translated error.
Definition at line 76 of file price_parser.class.php.