您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

TaxRateManager.php 568B

123456789101112131415161718192021222324
  1. <?php
  2. namespace domain\Config\TaxRate;
  3. use domain\_\AbstractManager;
  4. class TaxRateManager extends AbstractManager
  5. {
  6. protected TaxRateBuilder $taxRateBuilder;
  7. public function loadDependencies(): void
  8. {
  9. $this->taxRateBuilder = $this->loadService(TaxRateBuilder::class);
  10. }
  11. public function createTaxRate(string $name, float $value): TaxRate
  12. {
  13. $taxRate = $this->taxRateBuilder->instanciateTaxRate();
  14. $taxRate->setName($name);
  15. $taxRate->setValue($value);
  16. $taxRate->save();
  17. return $taxRate;
  18. }
  19. }