mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
Working IBAN account import thing.
This commit is contained in:
@@ -82,6 +82,24 @@ class AccountCrud implements AccountCrudInterface
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $iban
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public function findByIban(string $iban): Account
|
||||
{
|
||||
$accounts = $this->user->accounts()->where('iban', '!=', "")->get();
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
if ($account->iban === $iban) {
|
||||
return $account;
|
||||
}
|
||||
}
|
||||
|
||||
return new Account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $accountIds
|
||||
*
|
||||
|
||||
@@ -37,6 +37,13 @@ interface AccountCrudInterface
|
||||
*/
|
||||
public function find(int $accountId): Account;
|
||||
|
||||
/**
|
||||
* @param string $iban
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public function findByIban(string $iban): Account;
|
||||
|
||||
/**
|
||||
* @param array $accountIds
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user