mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-28 17:24:35 -06:00
Removed some unused code.
This commit is contained in:
parent
39dab4fdd9
commit
d43936155c
@ -119,7 +119,7 @@ class AccountCrud implements AccountCrudInterface
|
||||
*/
|
||||
public function findByIban(string $iban, array $types): Account
|
||||
{
|
||||
$query = $this->user->accounts()->where('iban', '!=', '');
|
||||
$query = $this->user->accounts()->where('iban', '!=', '')->whereNotNull('iban');
|
||||
|
||||
if (count($types) > 0) {
|
||||
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
@ -176,11 +176,7 @@ class AccountCrud implements AccountCrudInterface
|
||||
public function getAccountsById(array $accountIds): Collection
|
||||
{
|
||||
/** @var Collection $result */
|
||||
$query = $this->user->accounts()->with(
|
||||
['accountmeta' => function (HasMany $query) {
|
||||
$query->where('name', 'accountRole');
|
||||
}]
|
||||
);
|
||||
$query = $this->user->accounts();
|
||||
|
||||
if (count($accountIds) > 0) {
|
||||
$query->whereIn('accounts.id', $accountIds);
|
||||
@ -204,11 +200,7 @@ class AccountCrud implements AccountCrudInterface
|
||||
public function getAccountsByType(array $types): Collection
|
||||
{
|
||||
/** @var Collection $result */
|
||||
$query = $this->user->accounts()->with(
|
||||
['accountmeta' => function (HasMany $query) {
|
||||
$query->where('name', 'accountRole');
|
||||
}]
|
||||
);
|
||||
$query = $this->user->accounts();
|
||||
if (count($types) > 0) {
|
||||
$query->accountTypeIn($types);
|
||||
}
|
||||
@ -303,24 +295,6 @@ class AccountCrud implements AccountCrudInterface
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param string $type
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public function updateAccountType(Account $account, string $type): Account
|
||||
{
|
||||
$type = AccountType::whereType($type)->first();
|
||||
if (!is_null($type)) {
|
||||
$account->accountType()->associate($type);
|
||||
$account->save();
|
||||
}
|
||||
|
||||
return $this->find($account->id);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
|
@ -108,11 +108,4 @@ interface AccountCrudInterface
|
||||
*/
|
||||
public function update(Account $account, array $data): Account;
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param string $type
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public function updateAccountType(Account $account, string $type): Account;
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ class TransactionController extends Controller
|
||||
*/
|
||||
public function create(string $what = TransactionType::DEPOSIT)
|
||||
{
|
||||
/** @var AccountCrudInterface $crud */
|
||||
$crud = app(AccountCrudInterface::class);
|
||||
$budgetRepository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
$piggyRepository = app('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface');
|
||||
|
Loading…
Reference in New Issue
Block a user