From c3e6e4f034873174af9e7e499568fe0965c142a2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 27 Jan 2019 11:05:22 +0100 Subject: [PATCH] Simplify budget repository --- app/Repositories/Budget/BudgetRepository.php | 20 ------------------- .../Budget/BudgetRepositoryInterface.php | 9 --------- 2 files changed, 29 deletions(-) diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 35ae66946b..2695684119 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -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 * diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index decd8d2d21..e2cd595ec0 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -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 *