mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-23 09:26:29 -06:00
Remove deprecated method.
This commit is contained in:
parent
fb0d31226a
commit
e29b2066c2
@ -245,8 +245,7 @@ class BudgetLimitController extends Controller
|
||||
public function update(BudgetLimitRequest $request, BudgetLimit $budgetLimit): JsonResponse
|
||||
{
|
||||
$data = $request->getAll();
|
||||
$data['budget'] = $budgetLimit->budget;
|
||||
$budgetLimit = $this->blRepository->updateBudgetLimit($budgetLimit, $data);
|
||||
$budgetLimit = $this->blRepository->update($budgetLimit, $data);
|
||||
$manager = $this->getManager();
|
||||
|
||||
/** @var BudgetLimitTransformer $transformer */
|
||||
|
@ -337,29 +337,11 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
|
||||
*/
|
||||
public function update(BudgetLimit $budgetLimit, array $data): BudgetLimit
|
||||
{
|
||||
$budgetLimit->amount = $data['amount'] ?? $budgetLimit->amount;
|
||||
$budgetLimit->save();
|
||||
|
||||
return $budgetLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BudgetLimit $budgetLimit
|
||||
* @param array $data
|
||||
*
|
||||
* @return BudgetLimit
|
||||
* @throws Exception
|
||||
* @deprecated
|
||||
*/
|
||||
public function updateBudgetLimit(BudgetLimit $budgetLimit, array $data): BudgetLimit
|
||||
{
|
||||
/** @var Budget $budget */
|
||||
$budget = $data['budget'];
|
||||
|
||||
$budgetLimit->budget()->associate($budget);
|
||||
$budgetLimit->start_date = $data['start']->format('Y-m-d 00:00:00');
|
||||
$budgetLimit->end_date = $data['end']->format('Y-m-d 00:00:00');
|
||||
$budgetLimit->amount = $data['amount'];
|
||||
$budgetLimit->amount = $data['amount'] ?? $budgetLimit->amount;
|
||||
$budgetLimit->budget_id = $data['budget_id'] ?? $budgetLimit->id;
|
||||
$budgetLimit->budget_id = $data['budget'] ? $data['budget']->id : $budgetLimit->budget_id;
|
||||
$budgetLimit->start_date = $data['start'] ? $data['start']->format('Y-m-d 00:00:00') : $budgetLimit->start_date;
|
||||
$budgetLimit->end_date = $data['end'] ? $data['end']->format('Y-m-d 00:00:00') : $budgetLimit->end_date;
|
||||
|
||||
// if no currency has been provided, use the user's default currency:
|
||||
/** @var TransactionCurrencyFactory $factory */
|
||||
@ -370,9 +352,10 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
|
||||
}
|
||||
$currency->enabled = true;
|
||||
$currency->save();
|
||||
$budgetLimit->transaction_currency_id = $currency->id;
|
||||
|
||||
$budgetLimit->transaction_currency_id = $currency->id;
|
||||
$budgetLimit->save();
|
||||
|
||||
Log::debug(sprintf('Updated budget limit with ID #%d and amount %s', $budgetLimit->id, $data['amount']));
|
||||
|
||||
return $budgetLimit;
|
||||
|
@ -119,15 +119,6 @@ interface BudgetLimitRepositoryInterface
|
||||
*/
|
||||
public function update(BudgetLimit $budgetLimit, array $data): BudgetLimit;
|
||||
|
||||
/**
|
||||
* @param BudgetLimit $budgetLimit
|
||||
* @param array $data
|
||||
*
|
||||
* @return BudgetLimit
|
||||
* @deprecated
|
||||
*/
|
||||
public function updateBudgetLimit(BudgetLimit $budgetLimit, array $data): BudgetLimit;
|
||||
|
||||
/**
|
||||
* @param Budget $budget
|
||||
* @param Carbon $start
|
||||
|
Loading…
Reference in New Issue
Block a user