本文整理汇总了PHP中Invoice::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Invoice::destroy方法的具体用法?PHP Invoice::destroy怎么用?PHP Invoice::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Invoice
的用法示例。
在下文中一共展示了Invoice::destroy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
function destroy($params)
{
if (!isset($params['id'])) {
bail("Must haz id to do that!");
}
$inv = new Invoice($params['id']);
$inv->destroy();
$this->redirectTo(array('controller' => 'Invoice', 'action' => 'index'));
}
示例2: destroy
/**
* Remove the specified product from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Invoice::destroy($id);
return Response::json(array('success' => true, 'message' => 'Xóa phiếu thu chi thành công!'));
}
示例3: destroy
/**
* Remove the specified invoice from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Invoice::destroy($id);
return Redirect::route('invoices.index');
}
示例4: delete
/**
* Delete a quotation
*/
public function delete($id)
{
if (InvoiceItem::where('invoice_id', '=', $id)->delete()) {
if (Invoice::destroy($id)) {
return Redirect::route('invoice_list')->with('mSuccess', 'Le devis a bien été supprimé');
} else {
return Redirect::route('invoice_modify', $id)->with('mError', 'Impossible de supprimer ce devis');
}
} else {
return Redirect::route('invoice_modify', $id)->with('mError', 'Impossible de supprimer ce devis');
}
}
示例5: destroy
/**
* Remove the specified product from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$orderItems = OrdersItem::where('order_id', '=', $id)->get();
$invoices = Invoice::where('order_id', '=', $id)->get();
if ($orderItems) {
foreach ($orderItems as $orderItem) {
OrdersItem::destroy($orderItem->id);
}
}
if ($invoices) {
foreach ($invoices as $invoice) {
Invoice::destroy($invoice->id);
}
}
Order::destroy($id);
return Response::json(array('success' => true));
}