mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Simplify budget repository
This commit is contained in:
@@ -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
|
* Find a budget or return NULL
|
||||||
*
|
*
|
||||||
|
@@ -80,15 +80,6 @@ interface BudgetRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function destroyBudgetLimit(BudgetLimit $budgetLimit): void;
|
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
|
* @param int|null $budgetId
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user