예제 #1
0
 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;
 }
예제 #2
0
파일: Access.php 프로젝트: grlf/eyedock
 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;
 }
예제 #3
0
 function insert($reload = true)
 {
     $this->uploaded = $this->getDi()->time;
     return parent::insert($reload);
 }
예제 #4
0
 protected function _prepareForSet(&$vars)
 {
     if (isset($vars['pass'])) {
         unset($vars['pass']);
     }
     return parent::_prepareForSet($vars);
 }
예제 #5
0
 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;
 }
예제 #6
0
 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);
 }
예제 #7
0
 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;
 }
예제 #8
0
 public function __wakeup()
 {
     parent::__wakeup();
 }
예제 #9
0
 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;
 }
예제 #10
0
파일: Data.php 프로젝트: grlf/eyedock
 public function _get(Am_Record_WithData $record, $fontroller, $field)
 {
     return $record->data()->get($field);
 }
예제 #11
0
파일: Coupon.php 프로젝트: grlf/eyedock
 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;
 }