dolibarr 18.0.6
|
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 33 of file price_parser.class.php.
PriceParser::__construct | ( | $db | ) |
Constructor.
Definition at line 52 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 | $values | Strings to replaces |
Definition at line 125 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 | $extra_values | Any aditional values for expression |
Definition at line 253 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 | $extra_values | Any aditional values for expression |
Definition at line 300 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 | $extra_values | Any aditional values for expression |
Definition at line 331 of file price_parser.class.php.
References parseExpression().
PriceParser::translatedError | ( | ) |
Returns translated error.
Definition at line 62 of file price_parser.class.php.