Esempio n. 1
0
 /**
  * After save process
  *
  * @return $this
  */
 public function afterSave()
 {
     parent::afterSave();
     $this->_getResource()->saveLabel($this);
     $this->_getResource()->savePrices($this);
     return $this;
 }
Esempio n. 2
0
 /**
  * @return \Magento\Framework\Model\AbstractModel
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function afterSave()
 {
     $this->getValueInstance()->unsetValues();
     if (is_array($this->getData('values'))) {
         foreach ($this->getData('values') as $value) {
             $this->getValueInstance()->addValue($value);
         }
         $this->getValueInstance()->setOption($this)->saveValues();
     } elseif ($this->getGroupByType($this->getType()) == self::OPTION_GROUP_SELECT) {
         throw new LocalizedException(__('Select type options required values rows.'));
     }
     return parent::afterSave();
 }
Esempio n. 3
0
 /**
  * After save process
  *
  * @return $this
  */
 public function afterSave()
 {
     $this->getResource()->saveItemTitle($this);
     return parent::afterSave();
 }
Esempio n. 4
0
 /**
  * After save rule
  * Re-declared for populate rate calculations
  *
  * @return $this
  */
 public function afterSave()
 {
     parent::afterSave();
     $this->saveCalculationData();
     $this->_eventManager->dispatch('tax_settings_change_after');
     return $this;
 }
Esempio n. 5
0
 /**
  * Save related items
  *
  * @return $this
  */
 public function afterSave()
 {
     parent::afterSave();
     if (null !== $this->_addresses) {
         $this->getAddressesCollection()->save();
     }
     if (null !== $this->_items) {
         $this->getItemsCollection()->save();
     }
     if (null !== $this->_payments) {
         $this->getPaymentsCollection()->save();
     }
     if (null !== $this->_currentPayment) {
         $this->getPayment()->save();
     }
     return $this;
 }
Esempio n. 6
0
 /**
  * Save rate titles
  *
  * @return \Magento\Tax\Model\Calculation\Rate
  */
 public function afterSave()
 {
     $this->saveTitles();
     $this->_eventManager->dispatch('tax_settings_change_after');
     return parent::afterSave();
 }
Esempio n. 7
0
 /**
  * @return \Magento\Framework\Model\AbstractModel
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function afterSave()
 {
     $this->getValueInstance()->unsetValues();
     $values = $this->getValues() ?: $this->getData('values');
     if (is_array($values)) {
         foreach ($values as $value) {
             if ($value instanceof \Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface) {
                 $data = $value->getData();
             } else {
                 $data = $value;
             }
             $this->getValueInstance()->addValue($data);
         }
         $this->getValueInstance()->setOption($this)->saveValues();
     } elseif ($this->getGroupByType($this->getType()) == self::OPTION_GROUP_SELECT) {
         throw new LocalizedException(__('Select type options required values rows.'));
     }
     return parent::afterSave();
 }