Skip to content

Firefly III: a personal finances manager

Method to find an account.

James Cole55be17403735
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