mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Move CRUD method count() to account repository
This commit is contained in:
@@ -50,6 +50,20 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moved here from account CRUD
|
||||
*
|
||||
* @param array $types
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count(array $types):int
|
||||
{
|
||||
$count = $this->user->accounts()->accountTypeIn($types)->count();
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will call AccountRepositoryInterface::journalsInPeriod and get all withdrawaks made from the given $accounts,
|
||||
* as well as the transfers that move away from those $accounts. This is a slightly sharper selection
|
||||
|
Reference in New Issue
Block a user