function uc_taxes_rate_save in Ubercart 6.2
Same name and namespace in other branches
- 7.3 uc_taxes/uc_taxes.module \uc_taxes_rate_save()
Saves a tax rate to the database.
Parameters
$rate: The tax rate object to be saved.
Return value
The saved tax rate object including the rate ID for new rates.
2 calls to uc_taxes_rate_save()
- uc_taxes_clone in uc_taxes/
uc_taxes.admin.inc - Clones a tax rate.
- uc_taxes_form_submit in uc_taxes/
uc_taxes.admin.inc - Form submission handler for uc_taxes_form().
File
- uc_taxes/
uc_taxes.module, line 302
Code
function uc_taxes_rate_save($rate) {
// Save it as a new rate if no ID is specified.
if (!$rate->id) {
drupal_write_record('uc_taxes', $rate);
}
else {
drupal_write_record('uc_taxes', $rate, array(
'id',
));
}
return $rate;
}