mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-27 09:21:04 -06:00
Simplify budget repository
This commit is contained in:
parent
6c09330e74
commit
c3e6e4f034
@ -219,26 +219,6 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a budget.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return Budget|null
|
||||
*/
|
||||
public function findByName(string $name): ?Budget
|
||||
{
|
||||
$budgets = $this->user->budgets()->get(['budgets.*']);
|
||||
/** @var Budget $budget */
|
||||
foreach ($budgets as $budget) {
|
||||
if ($budget->name === $name) {
|
||||
return $budget;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a budget or return NULL
|
||||
*
|
||||
|
@ -80,15 +80,6 @@ interface BudgetRepositoryInterface
|
||||
*/
|
||||
public function destroyBudgetLimit(BudgetLimit $budgetLimit): void;
|
||||
|
||||
/**
|
||||
* Find a budget.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return Budget|null
|
||||
*/
|
||||
public function findByName(string $name): ?Budget;
|
||||
|
||||
/**
|
||||
* @param int|null $budgetId
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user