当前位置: 首页>>代码示例>>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;未经允许,请勿转载。