Simplify budget repository

This commit is contained in:
James Cole
2019-01-27 11:05:22 +01:00
parent 6c09330e74
commit c3e6e4f034
2 changed files with 0 additions and 29 deletions

View File

@@ -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
* *

View File

@@ -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
* *