當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Connection::commit方法代碼示例

本文整理匯總了PHP中Illuminate\Database\Connection::commit方法的典型用法代碼示例。如果您正苦於以下問題:PHP Connection::commit方法的具體用法?PHP Connection::commit怎麽用?PHP Connection::commit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Database\Connection的用法示例。


在下文中一共展示了Connection::commit方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: storeMultiple

 /**
  * Save multiple notifications sent
  * at once.
  *
  * @param  array $notifications
  * @return mixed
  */
 public function storeMultiple(array $notifications)
 {
     $this->db->beginTransaction();
     $stackId = $this->db->table($this->notification->getTable())->max('stack_id') + 1;
     foreach ($notifications as $key => $notification) {
         $notifications[$key]['stack_id'] = $stackId;
     }
     $insert = $this->db->table($this->notification->getTable())->insert($notifications);
     $this->db->commit();
     return $insert;
 }
開發者ID:fenos,項目名稱:notifynder,代碼行數:18,代碼來源:NotificationRepository.php

示例2: append

 /**
  * @param mixed $id
  * @param DomainEventStream $eventStream
  */
 public function append($id, DomainEventStream $eventStream)
 {
     $id = (string) $id;
     //Used to thrown errors if ID will not cast to string
     $this->db->beginTransaction();
     try {
         foreach ($eventStream as $domainMessage) {
             $this->insertEvent($domainMessage);
         }
         $this->db->commit();
     } catch (QueryException $ex) {
         $this->db->rollBack();
         throw $ex;
     }
 }
開發者ID:jrdnhannah,項目名稱:CQRS-ES-Framework-Laravel,代碼行數:19,代碼來源:LaravelEventStore.php

示例3: deleteReserved

 /**
  * Delete a reserved job from the queue.
  *
  * @param  string  $queue
  * @param  string  $id
  * @return void
  */
 public function deleteReserved($queue, $id)
 {
     $this->database->beginTransaction();
     if ($this->database->table($this->table)->lockForUpdate()->find($id)) {
         $this->database->table($this->table)->where('id', $id)->delete();
     }
     $this->database->commit();
 }
開發者ID:timpressive,項目名稱:art-auction,代碼行數:15,代碼來源:DatabaseQueue.php

示例4: pop

 /**
  * Pop the next job off of the queue.
  *
  * @param  string  $queue
  * @return \Illuminate\Contracts\Queue\Job|null
  */
 public function pop($queue = null)
 {
     $queue = $this->getQueue($queue);
     if (!is_null($this->expire)) {
         $this->releaseJobsThatHaveBeenReservedTooLong($queue);
     }
     if ($job = $this->getNextAvailableJob($queue)) {
         $this->markJobAsReserved($job->_id);
         return new MongodbJob($this->container, $this, $job, $queue);
     }
     $this->database->commit();
 }
開發者ID:jeremy-brenner,項目名稱:laravel-mongodb,代碼行數:18,代碼來源:MongodbQueue.php


注:本文中的Illuminate\Database\Connection::commit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。