Esempio n. 1
0
 /**
  * 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);
 }
Esempio n. 2
0
 /**
  * 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;
 }
Esempio n. 3
0
 /**
  * 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;
 }
Esempio n. 4
0
 /**
  * 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;
 }
Esempio n. 5
0
 /**
  * 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);
 }
Esempio n. 6
0
 /**
  * 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);
 }