public function delete() { parent::delete(); $this->runHooks(); $this->getDi()->hook->call(Am_Event::ACCESS_AFTER_DELETE, array('access' => $this)); return $this; }
function delete() { if ($this->user_id <= 0) { throw new Am_Exception_InternalError('Could not delete user, user_id is null'); } $this->getDi()->hook->call(Am_Event::USER_BEFORE_DELETE, array('user' => $this)); $this->getDi()->invoiceTable->deleteByUserId($this->user_id); $this->getDi()->accessTable->deleteByUserId($this->user_id); $this->checkSubscriptions(false); $this->getDi()->hook->call(new Am_Event_SubscriptionRemoved($this)); parent::delete(); foreach (array('?_access_log', '?_access_cache', '?_user_status', '?_user_user_group') as $table) { $this->getAdapter()->query("DELETE FROM {$table} WHERE user_id=?", $this->user_id); } $this->getDi()->couponBatchTable->deleteByUserId($this->user_id); $this->getDi()->hook->call(new Am_Event_UserAfterDelete($this)); }
function delete() { $fullPath = $this->getFullPath(); if (file_exists($fullPath)) { if (!unlink($fullPath)) { throw new Am_Exception_InternalError("Could not delete [{$fullPath}], and corresponding database records also is not deleted"); } } parent::delete(); }
public function delete() { $ret = parent::delete(); $this->deleteFromRelatedTable('?_billing_plan')->deleteFromRelatedTable('?_access')->deleteFromRelatedTable('?_user_status')->deleteFromRelatedTable('?_product_product_category'); $this->getTable()->getAdapter()->query("DELETE FROM ?_resource_access WHERE fn='product_id' AND id=?d", $this->pk()); return $ret; }
public function delete() { parent::delete(); $this->_table->getAdapter()->query("DELETE FROM ?_product_upgrade WHERE \n to_billing_plan_id=?d OR from_billing_plan_id=?d", $this->plan_id, $this->plan_id); }
public function delete() { $ret = parent::delete(); $this->deleteFromRelatedTable('?_billing_plan')->deleteFromRelatedTable('?_access')->deleteFromRelatedTable('?_user_status')->deleteFromRelatedTable('?_product_product_category'); $this->getTable()->getAdapter()->query("DELETE FROM ?_resource_access WHERE fn='product_id' AND id=?d", $this->pk()); $table_name = $this->getTable()->getName(); $this->getAdapter()->query("UPDATE {$table_name}\n SET sort_order=sort_order-1\n WHERE sort_order>?", $this->sort_order); $this->getDi()->hook->call(Am_Event::PRODUCT_AFTER_DELETE, array('product' => $this)); return $ret; }
/** * Dangerous! Deletes all related payments from 'payments' table * @see InvoicePayment * @see InvoiceItem */ function delete() { $this->deleteFromRelatedTable('?_invoice_item'); // $this->deleteFromRelatedTable('?_invoice_log'); // not good idea to delete $this->deleteFromRelatedTable('?_invoice_payment'); $this->deleteFromRelatedTable('?_invoice_refund'); $this->deleteFromRelatedTable('?_access'); parent::delete(); $this->getUser()->checkSubscriptions(true); return $this; }
/** * Dangerous! Deletes all related payments from 'payments' table * @see InvoicePayment * @see InvoiceItem */ function delete() { $this->getDi()->hook->call(Am_Event::INVOICE_BEFORE_DELETE, array('invoice' => $this)); foreach ($this->getItems() as $item) { $item->delete(); } // $this->deleteFromRelatedTable('?_invoice_log'); // not good idea to delete $this->deleteFromRelatedTable('?_invoice_payment'); $this->deleteFromRelatedTable('?_invoice_refund'); foreach ($this->getAccessRecords() as $access) { $access->delete(); } parent::delete(); $this->getUser()->checkSubscriptions(true); $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_DELETE, array('invoice' => $this)); return $this; }