本文整理汇总了PHP中Magento\Framework\Model\Resource\Db\AbstractDb::_afterDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractDb::_afterDelete方法的具体用法?PHP AbstractDb::_afterDelete怎么用?PHP AbstractDb::_afterDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Model\Resource\Db\AbstractDb
的用法示例。
在下文中一共展示了AbstractDb::_afterDelete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterDelete
/**
* Delete all Nonce entries associated with the consumer
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
public function _afterDelete(\Magento\Framework\Model\AbstractModel $object)
{
$adapter = $this->_getWriteAdapter();
$adapter->delete($this->getTable('oauth_nonce'), array('consumer_id' => $object->getId()));
$adapter->delete($this->getTable('oauth_token'), array('consumer_id' => $object->getId()));
return parent::_afterDelete($object);
}
示例2: _afterDelete
/**
* Perform actions after object delete
* Prepare rating data for reaggregate all data for reviews
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
protected function _afterDelete(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterDelete($object);
if (!$this->_ratingData->isModuleEnabled('Magento_Review')) {
return $this;
}
$data = $this->_getEntitySummaryData($object);
$summary = array();
foreach ($data as $row) {
$clone = clone $object;
$clone->addData($row);
$summary[$clone->getStoreId()][$clone->getEntityPkValue()] = $clone;
}
$this->_reviewSummary->reAggregate($summary);
return $this;
}
示例3: _afterDelete
/**
* After delete process
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
protected function _afterDelete(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterDelete($object);
$this->_getWriteAdapter()->delete($this->getTable('catalog_product_bundle_option_value'), array('option_id = ?' => $object->getId()));
return $this;
}
示例4: _afterDelete
/**
* Perform actions after object delete
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
protected function _afterDelete(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterDelete($object);
return $this;
}
示例5: _afterDelete
/**
* Perform actions after object delete.
* Delete layout updates by layout update ids collected in _beforeSave
*
* @param \Magento\Widget\Model\Widget\Instance $object
* @return $this
*/
protected function _afterDelete(AbstractModel $object)
{
$this->_deleteLayoutUpdates($object->getLayoutUpdateIdsToDelete());
return parent::_afterDelete($object);
}
示例6: _afterDelete
/**
* Method set default group id to the customers collection
*
* @param \Magento\Framework\Model\AbstractModel $group
* @return $this
*/
protected function _afterDelete(\Magento\Framework\Model\AbstractModel $group)
{
$customerCollection = $this->_createCustomersCollection()->addAttributeToFilter('group_id', $group->getId())->load();
foreach ($customerCollection as $customer) {
/** @var $customer \Magento\Customer\Model\Customer */
$customer->load($customer->getId());
$defaultGroupId = $this->_groupManagement->getDefaultGroup($customer->getStoreId())->getId();
$customer->setGroupId($defaultGroupId);
$customer->save();
}
return parent::_afterDelete($group);
}