/*
public static function storeDiscountsById($productId, $discsArray) {
if ((int)$productId > 0) {
$db =Factory::getDBO();
$query = ' DELETE '
.' FROM #__phocacart_product_discounts'
. ' WHERE product_id = '. (int)$productId;
$db->setQuery($query);
$db->execute();
if (!empty($discsArray)) {
$values = array();
foreach($discsArray as $k => $v) {
// Don't store empty discounts
/*if ($v['title'] == '') {
continue;
}*/
/*
if(empty($v['alias'])) {
$v['alias'] = $v['title'];
}
$v['alias'] = PhocacartUtils::getAliasName($v['alias']);
// correct simple xml
if (empty($v['title'])) {$v['title'] = '';}
if (empty($v['alias'])) {$v['alias'] = '';}
if (empty($v['access'])) {$v['access'] = '';}
if (empty($v['discount'])) {$v['discount'] = '';}
if (empty($v['calculation_type'])) {$v['calculation_type'] = '';}
if (empty($v['quantity_from'])) {$v['quantity_from'] = '';}
if (empty($v['quantity_to'])) {$v['quantity_to'] = '';}
if (empty($v['valid_from'])) {$v['valid_from'] = '';}
if (empty($v['valid_to'])) {$v['valid_to'] = '';}
if ($v['discount'] == '') {
continue;
}
$values[] = '('.(int)$productId.', '.$db->quote($v['title']).', '.$db->quote($v['alias']).', '.(int)$v['access'].', '.$db->quote($v['discount']).', '.(int)$v['calculation_type'].', '.(int)$v['quantity_from'].', '.(int)$v['quantity_to'].', '.$db->quote($v['valid_from']).', '.$db->quote($v['valid_to']).', '.(int)$k.')';
}
if (!empty($values)) {
$valuesString = implode(',', $values);
$query = ' INSERT INTO #__phocacart_product_discounts (product_id, title, alias, access, discount, calculation_type, quantity_from, quantity_to, valid_from, valid_to, ordering)'
.' VALUES '.(string)$valuesString;
$db->setQuery($query);
$db->execute();
}
}
}
}
*/
public final function __clone()
{
throw new Exception('Function Error: Cannot clone instance of Singleton pattern', 500);
return false;
}