Working IBAN account import thing.

This commit is contained in:
James Cole
2016-07-15 22:37:47 +02:00
parent c9e46a4dd1
commit 5130ba7ea4
3 changed files with 47 additions and 6 deletions

View File

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

View File

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