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


PHP Transaction::destroy方法代碼示例

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


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

示例1: destroy

 public function destroy()
 {
     $atomDao = new BaseDao("CertifierTransactionAtom");
     $atom = $atomDao->getPattern();
     $atom->transFid = $this->getId();
     $list = $atomDao->search($atom);
     //var_dump($list);
     foreach ($list as $element) {
         $element->delete();
     }
     parent::destroy();
 }
開發者ID:bobah,項目名稱:acbdb,代碼行數:12,代碼來源:CertifierTransaction.class.php

示例2: destroy

 /**
  * Remove the specified transaction from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $data = Input::all();
     $transaction = Transaction::find($id);
     $transactions = $transaction->getRecurringTransactions->filter(function ($t) {
         if ($t->user_id == Auth::id()) {
             return $t;
         }
     });
     if ($transaction->user_id == Auth::id()) {
         /**
          * 	DESTROY ONLY...
          */
         switch (@$data['apply_changes_to']) {
             case 'this':
                 Transaction::destroy($transaction->id);
                 break;
             case 'next':
                 $transactions = $transactions->filter(function ($t) use($transaction) {
                     if ($t->date >= $transaction->date) {
                         return $t;
                     }
                 });
                 // DESTROY THE ITEMS
                 foreach ($transactions as $transaction) {
                     Transaction::destroy($transaction->id);
                 }
                 break;
             case 'unpaid':
                 $transactions = $transactions->filter(function ($t) {
                     if ($t->done != 1) {
                         return $t;
                     }
                 });
                 // DESTROY THE ITEMS
                 foreach ($transactions as $t) {
                     Transaction::destroy($t->id);
                 }
                 break;
             case 'all':
                 // DESTROY THE ITEMS
                 // echo "<pre>";
                 // print_r($transactions->count());
                 // exit;
                 foreach ($transactions as $t) {
                     $t->destroy($t->id);
                 }
                 break;
             default:
                 // SAME OF 'THIS'
                 Transaction::destroy($transaction->id);
                 break;
         }
         $alert[] = ['class' => 'alert-success', 'message' => '<strong><i class="fa fa-check"></i></strong> Lançamento excluído!'];
     } else {
         $alert[] = ['class' => 'alert-danger', 'message' => '<strong><i class="fa fa-check"></i></strong> Sem permissão para excluir o lançamento!'];
     }
     Session::flash('alerts', $alert);
     return Redirect::to(URL::previous());
 }
開發者ID:waldenylson,項目名稱:alfredapp,代碼行數:66,代碼來源:TransactionsController.php

示例3: destroy

 /**
  * Remove the specified resource from storage.
  * DELETE /transactions/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     Transaction::destroy($id);
 }
開發者ID:sharad23,項目名稱:angular,代碼行數:12,代碼來源:TransactionsController.php

示例4: destroy

 /**
  * Remove the specified resource from storage.
  * DELETE /transactions/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $status = Transaction::destroy($id);
     return $status ? ['status' => true] : ['status' => false];
 }
開發者ID:anildukkipatty,項目名稱:fu,代碼行數:12,代碼來源:TransactionsController.php


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