public function insert($reload = true) { if ($this->currency == Am_Currency::getDefault()) { $this->base_currency_multi = 1.0; } else { $this->base_currency_multi = $this->getDi()->currencyExchangeTable->getRate($this->currency, sqlDate($this->dattm)); } $ret = parent::insert($reload); $this->setDisplayInvoiceId(); $this->getDi()->hook->call('refundAfterInsert', array('invoice' => $this->getInvoice(), 'refund' => $this, 'user' => $this->getInvoice()->getUser())); return $ret; }
public function update() { $hm = $this->getDi()->hook; if ($hm->have(Am_Event::ACCESS_AFTER_UPDATE)) { $old = $this->getTable()->load($this->pk()); } parent::update(); $this->runHooks(); if ($hm->have(Am_Event::ACCESS_AFTER_UPDATE)) { $this->getDi()->hook->call(Am_Event::ACCESS_AFTER_UPDATE, array('access' => $this, 'old' => $old)); } return $this; }
function insert($reload = true) { $this->uploaded = $this->getDi()->time; return parent::insert($reload); }
protected function _prepareForSet(&$vars) { if (isset($vars['pass'])) { unset($vars['pass']); } return parent::_prepareForSet($vars); }
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; }
public function __wakeup() { parent::__wakeup(); }
public function insert($reload = true) { if ($this->currency == Am_Currency::getDefault()) { $this->base_currency_multi = 1.0; } else { $this->base_currency_multi = $this->getDi()->currencyExchangeTable->getRate($this->currency, sqlDate($this->dattm)); } $this->getDi()->hook->call(new Am_Event(Am_Event::PAYMENT_BEFORE_INSERT, array('payment' => $this, 'invoice' => $this->getInvoice(), 'user' => $this->getInvoice()->getUser()))); parent::insert($reload); $this->setDisplayInvoiceId(); $this->getDi()->hook->call(new Am_Event_PaymentAfterInsert(null, array('payment' => $this, 'invoice' => $this->getInvoice(), 'user' => $this->getInvoice()->getUser()))); return $this; }
public function _get(Am_Record_WithData $record, $fontroller, $field) { return $record->data()->get($field); }
public function update() { $hm = $this->getDi()->hook; if ($hm->have(Am_Event::COUPON_BEFORE_UPDATE)) { $old = $this->getTable()->load($this->pk()); $old->toggleFrozen(true); $hm->call(Am_Event::COUPON_BEFORE_UPDATE, array('coupon' => $this, 'old' => $old)); } if (!$this->user_id) { $this->user_id = null; } if (!is_numeric($this->user_id)) { $user = $this->getDi()->userTable->findFirstByLogin($this->user_id); $this->user_id = $user ? $user->pk() : null; } parent::update(); return $this; }