本文整理汇总了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();
}
示例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());
}
示例3: destroy
/**
* Remove the specified resource from storage.
* DELETE /transactions/{id}
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
Transaction::destroy($id);
}
示例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];
}