本文整理汇总了PHP中Tax::getAllTaxes方法的典型用法代码示例。如果您正苦于以下问题:PHP Tax::getAllTaxes方法的具体用法?PHP Tax::getAllTaxes怎么用?PHP Tax::getAllTaxes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tax
的用法示例。
在下文中一共展示了Tax::getAllTaxes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* List all system currencies
* @return ActionResponse
*/
public function index()
{
$response = new ActionResponse();
$taxesForms = array();
$taxes = array();
foreach (Tax::getAllTaxes() as $tax) {
$taxes[] = $tax->toArray();
$taxesForms[] = $this->createTaxForm($tax);
}
$response->set("taxesForms", $taxesForms);
$response->set("taxes", $taxes);
$newTax = Tax::getNewInstance('');
$response->set("newTaxForm", $this->createTaxForm($newTax));
$response->set("newTax", $newTax->toArray());
return $this->appendTaxRates($response);
}
示例2: createTaxRateFormValidator
/**
* @return RequestValidator
*/
private function createTaxRateFormValidator()
{
$validator = $this->getValidator('shippingService', $this->request);
$taxes = Tax::getAllTaxes();
$classes = TaxClass::getAllClasses();
foreach ($taxes as $tax) {
$this->setFieldValidation($validator, $tax, null);
foreach ($classes as $class) {
$this->setFieldValidation($validator, $tax, $class);
}
}
return $validator;
}