From 55be17403735d1437be53bef534459ec81bffd9c Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 4 Dec 2015 06:56:45 +0100 Subject: [PATCH] Method to find an account. --- app/Repositories/Account/AccountRepository.php | 10 ++++++++++ .../Account/AccountRepositoryInterface.php | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index a19cf45840..b0c921b214 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -643,4 +643,14 @@ class AccountRepository implements AccountRepositoryInterface return $journal; } + + /** + * @param $accountId + * + * @return Account + */ + public function find($accountId) + { + return Auth::user()->accounts()->findOrNew($accountId); + } } diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 86dcb2e616..a3bdd05ec7 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -24,6 +24,13 @@ interface AccountRepositoryInterface */ public function countAccounts(array $types); + /** + * @param $accountId + * + * @return Account + */ + public function find($accountId); + /** * @param Account $account * @param Account $moveTo