當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AbstractDb::_afterDelete方法代碼示例

本文整理匯總了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);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:13,代碼來源:Consumer.php

示例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;
 }
開發者ID:pavelnovitsky,項目名稱:magento2,代碼行數:23,代碼來源:Rating.php

示例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;
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:12,代碼來源:Option.php

示例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;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:11,代碼來源:Entity.php

示例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);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:12,代碼來源:Instance.php

示例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);
 }
開發者ID:shazal,項目名稱:magento2,代碼行數:18,代碼來源:Group.php


注:本文中的Magento\Framework\Model\Resource\Db\AbstractDb::_afterDelete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。