示例#1
0
 public function insert($reload = true)
 {
     parent::insert($reload);
     $this->runHooks();
     $this->getDi()->hook->call(Am_Event::ACCESS_AFTER_INSERT, array('access' => $this));
     return $this;
 }
示例#2
0
 public function insert($reload = true)
 {
     $table_name = $this->getTable()->getName();
     $max = $this->getAdapter()->selectCell("SELECT MAX(sort_order) FROM {$table_name}");
     $this->sort_order = $max + 1;
     return parent::insert($reload);
 }
 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));
     }
     parent::insert($reload);
     $this->getDi()->hook->call(new Am_Event_PaymentAfterInsert(null, array('payment' => $this, 'invoice' => $this->getInvoice(), 'user' => $this->getInvoice()->getUser())));
     return $this;
 }
 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->getDi()->hook->call('refundAfterInsert', array('invoice' => $this->getInvoice(), 'refund' => $this, 'user' => $this->getInvoice()->getUser()));
     return $ret;
 }
 /**
  * before record insertion generate new ticket mask. if the mask is generated, try
  * 20 times to generate new mask, then throw exception
  * @return type 
  */
 public function insert($reload = true)
 {
     $maxAttempts = 20;
     for ($i = 0; $i <= $maxAttempts; $i++) {
         try {
             $this->_generateMask();
             return parent::insert($reload);
         } catch (Am_Exception_Db_NotUnique $e) {
             if ($i >= $maxAttempts) {
                 throw new Am_Exception_InternalError("Could not generate new ticket mask after [{$i}] attempts");
             }
             $this->ticket_mask = null;
         }
     }
 }
示例#6
0
 /**
  * before record insertion generate new ticket mask. if the generated mask is not unique,
  * try 20 times to generate new mask, then throw exception
  * @return type 
  */
 public function insert($reload = true)
 {
     $event = new Am_Event(Bootstrap_Helpdesk::EVENT_TICKET_BEFORE_INSERT, array('ticket' => $this));
     $this->getDi()->hook->call($event);
     $maxAttempts = 20;
     for ($i = 0; $i <= $maxAttempts; $i++) {
         try {
             $this->_generateMask();
             parent::insert($reload);
             $event = new Am_Event(Bootstrap_Helpdesk::EVENT_TICKET_AFTER_INSERT, array('ticket' => $this));
             $this->getDi()->hook->call($event);
             return $this;
         } catch (Am_Exception_Db_NotUnique $e) {
             if ($i >= $maxAttempts) {
                 throw new Am_Exception_InternalError("Could not generate new ticket mask after [{$i}] attempts");
             }
             $this->ticket_mask = null;
         }
     }
 }
示例#7
0
 public function insert($reload = true)
 {
     $ret = parent::insert(true);
     $max = $this->getAdapter()->selectCell("SELECT MAX(sort_order) FROM ?_resource_access_sort");
     $this->getAdapter()->query("\n            INSERT INTO ?_resource_access_sort\n            SET resource_id=?d, resource_type=?,\n                sort_order=?d\n        ", $this->pk(), $this->getAccessType(), 1 + $max);
     return $ret;
 }
示例#8
0
 /**
  * Insert any collected fields before starting with child records
  */
 function startNestedTables()
 {
     if ($this->record) {
         $this->record->insert();
     }
 }
示例#9
0
 public function insert($reload = true)
 {
     if (!$this->_disablePostbackLog) {
         parent::insert($reload);
     }
     return $this;
 }
示例#10
0
文件: State.php 项目: grlf/eyedock
 function insert($reload = true)
 {
     $this->status = self::STATUS_ADDED;
     parent::insert($reload);
 }
示例#11
0
 public function insert($reload = true)
 {
     $table_name = $this->getTable()->getName();
     $this->getAdapter()->query("UPDATE {$table_name}\n            SET sort_order=sort_order+1");
     $this->sort_order = 1;
     $ret = parent::insert($reload);
     $this->saveAccess($this->_access);
     return $ret;
 }
示例#12
0
 public function insert($reload = true)
 {
     parent::insert($reload);
     if ($this->_dataStorage) {
         $this->_dataStorage->insert();
     }
     return $this;
 }
示例#13
0
 function insert($reload = true)
 {
     $ret = parent::insert($reload);
     $this->getDi()->hook->call(Bootstrap_Aff::AFF_COMMISSION_AFTER_INSERT, array('commission' => $this, 'user' => $this->getInvoice() ? $this->getInvoice()->getUser() : null, 'aff' => $this->getAff(), 'invoice' => $this->getInvoice(), 'payment' => $this->getPayment()));
     return $ret;
 }