Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function _setDataValues(array $data)
 {
     if (isset($data[Item::KEY_APPLIED_TAXES])) {
         $appliedTaxDataObjects = [];
         $appliedTaxes = $data[Item::KEY_APPLIED_TAXES];
         foreach ($appliedTaxes as $appliedTax) {
             $appliedTaxDataObjects[] = $this->appliedTaxBuilder->populateWithArray($appliedTax)->create();
         }
         $data[Item::KEY_APPLIED_TAXES] = $appliedTaxDataObjects;
     }
     return parent::_setDataValues($data);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function _setDataValues(array $data)
 {
     if (isset($data[TaxDetails::KEY_APPLIED_TAXES])) {
         $appliedTaxDataObjects = [];
         $appliedTaxes = $data[TaxDetails::KEY_APPLIED_TAXES];
         foreach ($appliedTaxes as $appliedTax) {
             $appliedTaxDataObjects[] = $this->appliedTaxBuilder->populateWithArray($appliedTax)->create();
         }
         $data[TaxDetails::KEY_APPLIED_TAXES] = $appliedTaxDataObjects;
     }
     if (isset($data[TaxDetails::KEY_ITEMS])) {
         $taxDetailItemDataObjects = [];
         $taxDetailItems = $data[TaxDetails::KEY_ITEMS];
         foreach ($taxDetailItems as $taxDetailItem) {
             $taxDetailItemDataObjects[] = $this->taxDetailsItemBuilder->populateWithArray($taxDetailItem)->create();
         }
         $data[TaxDetails::KEY_ITEMS] = $taxDetailItemDataObjects;
     }
     return parent::_setDataValues($data);
 }