本文整理汇总了PHP中Magento\Framework\Model\AbstractExtensibleModel::afterSave方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractExtensibleModel::afterSave方法的具体用法?PHP AbstractExtensibleModel::afterSave怎么用?PHP AbstractExtensibleModel::afterSave使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Model\AbstractExtensibleModel
的用法示例。
在下文中一共展示了AbstractExtensibleModel::afterSave方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterSave
/**
* After save process
*
* @return $this
*/
public function afterSave()
{
parent::afterSave();
$this->_getResource()->saveLabel($this);
$this->_getResource()->savePrices($this);
return $this;
}
示例2: afterSave
/**
* @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();
}
示例3: afterSave
/**
* After save process
*
* @return $this
*/
public function afterSave()
{
$this->getResource()->saveItemTitle($this);
return parent::afterSave();
}
示例4: 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;
}
示例5: afterSave
/**
* 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;
}
示例6: afterSave
/**
* Save rate titles
*
* @return \Magento\Tax\Model\Calculation\Rate
*/
public function afterSave()
{
$this->saveTitles();
$this->_eventManager->dispatch('tax_settings_change_after');
return parent::afterSave();
}
示例7: 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();
}