/** * After save process * * @return $this */ public function afterSave() { parent::afterSave(); $this->_getResource()->saveLabel($this); $this->_getResource()->savePrices($this); return $this; }
/** * @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(); }
/** * After save process * * @return $this */ public function afterSave() { $this->getResource()->saveItemTitle($this); return parent::afterSave(); }
/** * 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; }
/** * 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; }
/** * Save rate titles * * @return \Magento\Tax\Model\Calculation\Rate */ public function afterSave() { $this->saveTitles(); $this->_eventManager->dispatch('tax_settings_change_after'); return parent::afterSave(); }
/** * @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(); }