mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
PHPStorm can order methods by alphabet, who knew.
This commit is contained in:
@@ -121,21 +121,6 @@ class AccountFactory
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function find(string $accountName, string $accountType): ?Account
|
||||
{
|
||||
app('log')->debug(sprintf('Now in AccountFactory::find("%s", "%s")', $accountName, $accountType));
|
||||
$type = AccountType::whereType($accountType)->first();
|
||||
|
||||
// @var Account|null
|
||||
return $this->user->accounts()->where('account_type_id', $type->id)->where('name', $accountName)->first();
|
||||
}
|
||||
|
||||
public function setUser(User $user): void
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->accountRepository->setUser($user);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
@@ -169,6 +154,15 @@ class AccountFactory
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function find(string $accountName, string $accountType): ?Account
|
||||
{
|
||||
app('log')->debug(sprintf('Now in AccountFactory::find("%s", "%s")', $accountName, $accountType));
|
||||
$type = AccountType::whereType($accountType)->first();
|
||||
|
||||
// @var Account|null
|
||||
return $this->user->accounts()->where('account_type_id', $type->id)->where('name', $accountName)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
@@ -365,4 +359,10 @@ class AccountFactory
|
||||
$updateService->setUser($account->user);
|
||||
$updateService->update($account, ['order' => $order]);
|
||||
}
|
||||
|
||||
public function setUser(User $user): void
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->accountRepository->setUser($user);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user