20 private $taxRateModelFactory;
27 private $taxRateRegistryById = [];
35 TaxRateModelFactory $taxModelRateFactory
37 $this->taxRateModelFactory = $taxModelRateFactory;
48 $this->taxRateRegistryById[$taxRateModel->getId()] = $taxRateModel;
58 public function retrieveTaxRate($taxRateId)
60 if (isset($this->taxRateRegistryById[$taxRateId])) {
61 return $this->taxRateRegistryById[$taxRateId];
64 $taxRateModel = $this->taxRateModelFactory->create()->load($taxRateId);
65 if (!$taxRateModel->getId()) {
69 $this->taxRateRegistryById[$taxRateModel->getId()] = $taxRateModel;
81 unset($this->taxRateRegistryById[$taxRateId]);
static singleField($fieldName, $fieldValue)
registerTaxRate(TaxRateModel $taxRateModel)
__construct(TaxRateModelFactory $taxModelRateFactory)
removeTaxRate($taxRateId)