mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 08:11:20 +00:00
Removed some unused code.
This commit is contained in:
@@ -119,7 +119,7 @@ class AccountCrud implements AccountCrudInterface
|
|||||||
*/
|
*/
|
||||||
public function findByIban(string $iban, array $types): Account
|
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) {
|
if (count($types) > 0) {
|
||||||
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
$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
|
public function getAccountsById(array $accountIds): Collection
|
||||||
{
|
{
|
||||||
/** @var Collection $result */
|
/** @var Collection $result */
|
||||||
$query = $this->user->accounts()->with(
|
$query = $this->user->accounts();
|
||||||
['accountmeta' => function (HasMany $query) {
|
|
||||||
$query->where('name', 'accountRole');
|
|
||||||
}]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (count($accountIds) > 0) {
|
if (count($accountIds) > 0) {
|
||||||
$query->whereIn('accounts.id', $accountIds);
|
$query->whereIn('accounts.id', $accountIds);
|
||||||
@@ -204,11 +200,7 @@ class AccountCrud implements AccountCrudInterface
|
|||||||
public function getAccountsByType(array $types): Collection
|
public function getAccountsByType(array $types): Collection
|
||||||
{
|
{
|
||||||
/** @var Collection $result */
|
/** @var Collection $result */
|
||||||
$query = $this->user->accounts()->with(
|
$query = $this->user->accounts();
|
||||||
['accountmeta' => function (HasMany $query) {
|
|
||||||
$query->where('name', 'accountRole');
|
|
||||||
}]
|
|
||||||
);
|
|
||||||
if (count($types) > 0) {
|
if (count($types) > 0) {
|
||||||
$query->accountTypeIn($types);
|
$query->accountTypeIn($types);
|
||||||
}
|
}
|
||||||
@@ -303,24 +295,6 @@ class AccountCrud implements AccountCrudInterface
|
|||||||
return $account;
|
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
|
* @param array $data
|
||||||
*
|
*
|
||||||
|
@@ -108,11 +108,4 @@ interface AccountCrudInterface
|
|||||||
*/
|
*/
|
||||||
public function update(Account $account, array $data): Account;
|
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)
|
public function create(string $what = TransactionType::DEPOSIT)
|
||||||
{
|
{
|
||||||
|
/** @var AccountCrudInterface $crud */
|
||||||
$crud = app(AccountCrudInterface::class);
|
$crud = app(AccountCrudInterface::class);
|
||||||
$budgetRepository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
$budgetRepository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||||
$piggyRepository = app('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface');
|
$piggyRepository = app('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface');
|
||||||
|
Reference in New Issue
Block a user