Схема
public mixed
editTaxClass (
$tax_class_id, $data )
Аргументы
| Аргумент |
Возможный тип |
Описание |
| $tax_class_id |
— |
— |
| $data |
— |
— |
Описание
Метод пока еще не документирован.
Исходный код
$this->db->query("UPDATE " . DB_PREFIX . "tax_class SET title = '" . $this->db->escape($data['title']) . "', description = '" . $this->db->escape($data['description']) . "', date_modified = NOW() WHERE tax_class_id = '" . (int)$tax_class_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "tax_rule WHERE tax_class_id = '" . (int)$tax_class_id . "'");
if (isset($data['tax_rule'])) {
foreach ($data['tax_rule'] as $tax_rule) {
$this->db->query("INSERT INTO " . DB_PREFIX . "tax_rule SET tax_class_id = '" . (int)$tax_class_id . "', tax_rate_id = '" . (int)$tax_rule['tax_rate_id'] . "', based = '" . $this->db->escape($tax_rule['based']) . "', priority = '" . (int)$tax_rule['priority'] . "'");
}
}
$this->cache->delete('tax_class');