Fix bug in API: missing destroy budget limit method.

This commit is contained in:
James Cole 2018-07-14 15:16:32 +02:00
parent 9116796d90
commit 0712f30a51
2 changed files with 21 additions and 0 deletions

View File

@ -196,6 +196,20 @@ class BudgetRepository implements BudgetRepositoryInterface
} }
} }
/**
* Destroy a budget limit.
*
* @param BudgetLimit $budgetLimit
*/
public function destroyBudgetLimit(BudgetLimit $budgetLimit): void
{
try {
$budgetLimit->delete();
} catch (Exception $e) {
Log::info(sprintf('Could not delete budget limit: %s', $e->getMessage()));
}
}
/** /**
* Filters entries from the result set generated by getBudgetPeriodReport. * Filters entries from the result set generated by getBudgetPeriodReport.
* *

View File

@ -46,6 +46,13 @@ interface BudgetRepositoryInterface
*/ */
public function budgetedPerDay(Budget $budget): string; public function budgetedPerDay(Budget $budget): string;
/**
* Destroy a budget limit.
*
* @param BudgetLimit $budgetLimit
*/
public function destroyBudgetLimit(BudgetLimit $budgetLimit): void;
/** /**
* @return bool * @return bool
*/ */