Ejemplo n.º 1
0
 /**
  * Register TaxRate Model to registry
  *
  * @param TaxRateModel $taxRateModel
  * @return void
  */
 public function registerTaxRate(TaxRateModel $taxRateModel)
 {
     $this->taxRateRegistryById[$taxRateModel->getId()] = $taxRateModel;
 }
Ejemplo n.º 2
0
 /**
  * Create an array with tax rate titles having tax rate model.
  *
  * @param TaxRateModel $rateModel
  * @return array
  */
 public function createTitleArrayFromModel(TaxRateModel $rateModel)
 {
     $titlesData = $rateModel->getTitles();
     $titles = [];
     if ($titlesData) {
         foreach ($titlesData as $title) {
             $titles[] = $this->taxRateTitleDataObjectBuilder->setStoreId($title->getStoreId())->setValue($title->getValue())->create();
         }
     }
     return $titles;
 }