mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Update app() calls
This commit is contained in:
@@ -79,7 +79,8 @@ class CreateImport extends Command
|
||||
$this->info(sprintf('Type of import: %s', $type));
|
||||
|
||||
/** @var ImportJobRepositoryInterface $jobRepository */
|
||||
$jobRepository = app(ImportJobRepositoryInterface::class, [$user]);
|
||||
$jobRepository = app(ImportJobRepositoryInterface::class);
|
||||
$jobRepository->setUser($user);
|
||||
$job = $jobRepository->create($type);
|
||||
$this->line(sprintf('Created job "%s"...', $job->key));
|
||||
|
||||
|
@@ -139,7 +139,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts(new Collection([$account]))->setRange($this->start, $this->end);
|
||||
$journals = $collector->getJournals();
|
||||
$journals = $journals->reverse();
|
||||
|
@@ -185,7 +185,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
|
||||
->setTypes([TransactionType::WITHDRAWAL])
|
||||
->setBudgets($this->budgets)->withOpposingAccount()->disableFilter();
|
||||
|
@@ -195,7 +195,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
|
||||
->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
|
||||
->setCategories($this->categories)->withOpposingAccount()->disableFilter();
|
||||
@@ -218,7 +219,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
|
||||
->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
|
||||
->setCategories($this->categories)->withOpposingAccount();
|
||||
|
@@ -85,7 +85,8 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
// also collect all other transactions
|
||||
if ($this->collectOtherObjects && $direction === 'expense') {
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::WITHDRAWAL]);
|
||||
$journals = $collector->getJournals();
|
||||
$sum = strval($journals->sum('transaction_amount'));
|
||||
@@ -96,7 +97,8 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
|
||||
if ($this->collectOtherObjects && $direction === 'income') {
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::DEPOSIT]);
|
||||
$journals = $collector->getJournals();
|
||||
$sum = strval($journals->sum('transaction_amount'));
|
||||
@@ -201,7 +203,8 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
$modifier = 1;
|
||||
}
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($this->accounts);
|
||||
$collector->setRange($this->start, $this->end);
|
||||
$collector->setTypes($types);
|
||||
@@ -258,7 +261,8 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
{
|
||||
$chartData = [];
|
||||
$names = [];
|
||||
$repository = app($this->repositories[$type], [$this->user]);
|
||||
$repository = app($this->repositories[$type]);
|
||||
$repository->setUser($this->user);
|
||||
foreach ($array as $objectId => $amount) {
|
||||
if (!isset($names[$objectId])) {
|
||||
$object = $repository->find(intval($objectId));
|
||||
|
@@ -233,7 +233,8 @@ class JournalCollector implements JournalCollectorInterface
|
||||
public function setAllAssetAccounts(): JournalCollectorInterface
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
$accounts = $repository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT]);
|
||||
if ($accounts->count() > 0) {
|
||||
$accountIds = $accounts->pluck('id')->toArray();
|
||||
|
@@ -68,7 +68,8 @@ class ReportHelper implements ReportHelperInterface
|
||||
/** @var BillRepositoryInterface $repository */
|
||||
$repository = app(BillRepositoryInterface::class);
|
||||
$bills = $repository->getBillsForAccounts($accounts);
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($accounts)->setRange($start, $end)->setBills($bills);
|
||||
$journals = $collector->getJournals();
|
||||
$collection = new BillCollection;
|
||||
|
@@ -23,7 +23,6 @@ use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
|
||||
use FireflyIII\Repositories\Account\AccountTaskerInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
@@ -97,12 +96,12 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ARI $repository
|
||||
* @param Account $account
|
||||
* @param AccountRepositoryInterface $repository
|
||||
* @param Account $account
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function delete(ARI $repository, Account $account)
|
||||
public function delete(AccountRepositoryInterface $repository, Account $account)
|
||||
{
|
||||
$typeName = config('firefly.shortNamesByFullName.' . $account->accountType->type);
|
||||
$subTitle = trans('firefly.delete_' . $typeName . '_account', ['name' => $account->name]);
|
||||
@@ -119,12 +118,12 @@ class AccountController extends Controller
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ARI $repository
|
||||
* @param AccountRepositoryInterface $repository
|
||||
* @param Account $account
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function destroy(Request $request, ARI $repository, Account $account)
|
||||
public function destroy(Request $request, AccountRepositoryInterface $repository, Account $account)
|
||||
{
|
||||
$type = $account->accountType->type;
|
||||
$typeName = config('firefly.shortNamesByFullName.' . $type);
|
||||
@@ -199,12 +198,12 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ARI $repository
|
||||
* @param AccountRepositoryInterface $repository
|
||||
* @param string $what
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function index(ARI $repository, string $what)
|
||||
public function index(AccountRepositoryInterface $repository, string $what)
|
||||
{
|
||||
$what = $what ?? 'asset';
|
||||
$subTitle = trans('firefly.' . $what . '_accounts');
|
||||
@@ -270,7 +269,7 @@ class AccountController extends Controller
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ARI $repository
|
||||
* @param AccountRepositoryInterface $repository
|
||||
* @param Account $account
|
||||
*
|
||||
* @return View
|
||||
@@ -284,7 +283,8 @@ class AccountController extends Controller
|
||||
|
||||
// replace with journal collector:
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts(new Collection([$account]))->setLimit($pageSize)->setPage($page);
|
||||
$journals = $collector->getPaginatedJournals();
|
||||
$journals->setPath('accounts/show/' . $account->id . '/all');
|
||||
@@ -318,7 +318,8 @@ class AccountController extends Controller
|
||||
|
||||
// replace with journal collector:
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts(new Collection([$account]))->setRange($start, $end)->setLimit($pageSize)->setPage($page);
|
||||
$journals = $collector->getPaginatedJournals();
|
||||
$journals->setPath('accounts/show/' . $account->id . '/' . $date);
|
||||
@@ -332,12 +333,12 @@ class AccountController extends Controller
|
||||
|
||||
/**
|
||||
* @param AccountFormRequest $request
|
||||
* @param ARI $repository
|
||||
* @param AccountRepositoryInterface $repository
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*
|
||||
*/
|
||||
public function store(AccountFormRequest $request, ARI $repository)
|
||||
public function store(AccountFormRequest $request, AccountRepositoryInterface $repository)
|
||||
{
|
||||
$data = $request->getAccountData();
|
||||
$account = $repository->store($data);
|
||||
@@ -365,12 +366,12 @@ class AccountController extends Controller
|
||||
|
||||
/**
|
||||
* @param AccountFormRequest $request
|
||||
* @param ARI $repository
|
||||
* @param AccountRepositoryInterface $repository
|
||||
* @param Account $account
|
||||
*
|
||||
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function update(AccountFormRequest $request, ARI $repository, Account $account)
|
||||
public function update(AccountFormRequest $request, AccountRepositoryInterface $repository, Account $account)
|
||||
{
|
||||
$data = $request->getAccountData();
|
||||
$repository->update($account, $data);
|
||||
@@ -417,8 +418,8 @@ class AccountController extends Controller
|
||||
*/
|
||||
private function periodEntries(Account $account): Collection
|
||||
{
|
||||
/** @var ARI $repository */
|
||||
$repository = app(ARI::class);
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
/** @var AccountTaskerInterface $tasker */
|
||||
$tasker = app(AccountTaskerInterface::class);
|
||||
|
||||
|
@@ -215,7 +215,8 @@ class BillController extends Controller
|
||||
|
||||
// use collector:
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAllAssetAccounts()->setBills(new Collection([$bill]))->setLimit($pageSize)->setPage($page)->withBudgetInformation()
|
||||
->withCategoryInformation();
|
||||
$journals = $collector->getPaginatedJournals();
|
||||
|
@@ -212,7 +212,8 @@ class BudgetController extends Controller
|
||||
|
||||
// collector
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAllAssetAccounts()->setRange($start, $end)->setLimit($pageSize)->setPage($page)->withoutBudget();
|
||||
$journals = $collector->getPaginatedJournals();
|
||||
$journals->setPath('/budgets/list/noBudget');
|
||||
@@ -253,7 +254,8 @@ class BudgetController extends Controller
|
||||
$repetition = null;
|
||||
// collector:
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAllAssetAccounts()->setRange($start, $end)->setBudget($budget)->setLimit($pageSize)->setPage($page)->withCategoryInformation();
|
||||
$journals = $collector->getPaginatedJournals();
|
||||
$journals->setPath('/budgets/show/' . $budget->id);
|
||||
@@ -290,7 +292,8 @@ class BudgetController extends Controller
|
||||
|
||||
// collector:
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAllAssetAccounts()->setRange($budgetLimit->start_date, $budgetLimit->end_date)
|
||||
->setBudget($budget)->setLimit($pageSize)->setPage($page)->withCategoryInformation();
|
||||
$journals = $collector->getPaginatedJournals();
|
||||
|
@@ -165,7 +165,8 @@ class CategoryController extends Controller
|
||||
|
||||
// new collector:
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAllAssetAccounts()->setRange($start, $end)->withoutCategory();//->groupJournals();
|
||||
$journals = $collector->getJournals();
|
||||
$subTitle = trans(
|
||||
|
@@ -416,7 +416,8 @@ class BudgetController extends Controller
|
||||
{
|
||||
// collector
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$types = [TransactionType::WITHDRAWAL];
|
||||
$collector->setAllAssetAccounts()->setTypes($types)->setRange($start, $end)->withoutBudget();
|
||||
$journals = $collector->getJournals();
|
||||
|
@@ -239,7 +239,8 @@ class BudgetReportController extends Controller
|
||||
private function getExpenses(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end): Collection
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
|
||||
->setBudgets($budgets)->withOpposingAccount()->disableFilter();
|
||||
$accountIds = $accounts->pluck('id')->toArray();
|
||||
|
@@ -284,7 +284,8 @@ class CategoryReportController extends Controller
|
||||
private function getExpenses(Collection $accounts, Collection $categories, Carbon $start, Carbon $end): Collection
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
|
||||
->setCategories($categories)->withOpposingAccount()->disableFilter();
|
||||
$accountIds = $accounts->pluck('id')->toArray();
|
||||
@@ -305,7 +306,8 @@ class CategoryReportController extends Controller
|
||||
private function getIncome(Collection $accounts, Collection $categories, Carbon $start, Carbon $end): Collection
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
|
||||
->setCategories($categories)->withOpposingAccount();
|
||||
$accountIds = $accounts->pluck('id')->toArray();
|
||||
|
@@ -150,7 +150,8 @@ class ExportController extends Controller
|
||||
$jobs->changeStatus($job, 'export_status_make_exporter');
|
||||
|
||||
/** @var ProcessorInterface $processor */
|
||||
$processor = app(ProcessorInterface::class, [$settings]);
|
||||
$processor = app(ProcessorInterface::class);
|
||||
$processor->setSettings($settings);
|
||||
|
||||
/*
|
||||
* Collect journals:
|
||||
|
@@ -103,7 +103,8 @@ class ReportController extends Controller
|
||||
switch (true) {
|
||||
case ($role === BalanceLine::ROLE_DEFAULTROLE && !is_null($budget->id)):
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector
|
||||
->setAccounts(new Collection([$account]))
|
||||
->setRange($attributes['startDate'], $attributes['endDate'])
|
||||
@@ -114,7 +115,8 @@ class ReportController extends Controller
|
||||
case ($role === BalanceLine::ROLE_DEFAULTROLE && is_null($budget->id)):
|
||||
$budget->name = strval(trans('firefly.no_budget'));
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector
|
||||
->setAccounts(new Collection([$account]))
|
||||
->setTypes($types)
|
||||
@@ -124,7 +126,8 @@ class ReportController extends Controller
|
||||
break;
|
||||
case ($role === BalanceLine::ROLE_DIFFROLE):
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector
|
||||
->setAccounts(new Collection([$account]))
|
||||
->setTypes($types)
|
||||
@@ -169,7 +172,8 @@ class ReportController extends Controller
|
||||
$repository = app(BudgetRepositoryInterface::class);
|
||||
$budget = $repository->find(intval($attributes['budgetId']));
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
|
||||
$collector
|
||||
->setAccounts($attributes['accounts'])
|
||||
@@ -203,7 +207,8 @@ class ReportController extends Controller
|
||||
$category = $repository->find(intval($attributes['categoryId']));
|
||||
$types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($attributes['accounts'])->setTypes($types)
|
||||
->setRange($attributes['startDate'], $attributes['endDate'])
|
||||
->setCategory($category);
|
||||
@@ -230,7 +235,8 @@ class ReportController extends Controller
|
||||
$account = $repository->find(intval($attributes['accountId']));
|
||||
$types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts(new Collection([$account]))->setRange($attributes['startDate'], $attributes['endDate'])->setTypes($types);
|
||||
$journals = $collector->getJournals();
|
||||
$report = $attributes['accounts']->pluck('id')->toArray(); // accounts used in this report
|
||||
@@ -266,7 +272,8 @@ class ReportController extends Controller
|
||||
$account = $repository->find(intval($attributes['accountId']));
|
||||
$types = [TransactionType::DEPOSIT, TransactionType::TRANSFER];
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts(new Collection([$account]))->setRange($attributes['startDate'], $attributes['endDate'])->setTypes($types);
|
||||
$journals = $collector->getJournals();
|
||||
$report = $attributes['accounts']->pluck('id')->toArray(); // accounts used in this report
|
||||
|
@@ -293,7 +293,7 @@ class RuleController extends Controller
|
||||
$range = config('firefly.test-triggers.range');
|
||||
|
||||
/** @var TransactionMatcher $matcher */
|
||||
$matcher = app('FireflyIII\Rules\TransactionMatcher');
|
||||
$matcher = app(TransactionMatcher::class);
|
||||
$matcher->setLimit($limit);
|
||||
$matcher->setRange($range);
|
||||
$matcher->setTriggers($triggers);
|
||||
@@ -357,7 +357,7 @@ class RuleController extends Controller
|
||||
private function createDefaultRule()
|
||||
{
|
||||
/** @var RuleRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Rule\RuleRepositoryInterface');
|
||||
$repository = app(RuleRepositoryInterface::class);
|
||||
|
||||
if ($repository->count() === 0) {
|
||||
$data = [
|
||||
|
@@ -72,7 +72,8 @@ class TransactionController extends Controller
|
||||
$end = session('end', Navigation::endOfPeriod(new Carbon, $range));
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setTypes($types)->setLimit($pageSize)->setPage($page)->setAllAssetAccounts();
|
||||
$collector->setRange($start, $end)->withBudgetInformation()->withCategoryInformation();
|
||||
|
||||
@@ -122,7 +123,8 @@ class TransactionController extends Controller
|
||||
$subTitle = sprintf('%s (%s)', trans('firefly.title_' . $what), strtolower(trans('firefly.everything')));
|
||||
$page = intval($request->get('page')) === 0 ? 1 : intval($request->get('page'));
|
||||
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setTypes($types)->setLimit($pageSize)->setPage($page)->setAllAssetAccounts()->withBudgetInformation()->withCategoryInformation();
|
||||
|
||||
// do not filter transfers if $what = transfer.
|
||||
@@ -161,7 +163,8 @@ class TransactionController extends Controller
|
||||
Log::debug(sprintf('Transaction index by date will show between %s and %s', $start->format('Y-m-d'), $end->format('Y-m-d')));
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setTypes($types)->setLimit($pageSize)->setPage($page)->setAllAssetAccounts();
|
||||
$collector->setRange($start, $end)->withBudgetInformation()->withCategoryInformation();
|
||||
|
||||
|
@@ -49,7 +49,8 @@ class RuleGroupFormRequest extends Request
|
||||
public function rules()
|
||||
{
|
||||
/** @var RuleGroupRepositoryInterface $repository */
|
||||
$repository = app(RuleGroupRepositoryInterface::class, [auth()->user()]);
|
||||
$repository = app(RuleGroupRepositoryInterface::class);
|
||||
$repository->setUser(auth()->user());
|
||||
$titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title';
|
||||
if (!is_null($repository->find(intval($this->get('id')))->id)) {
|
||||
$titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title,' . intval($this->get('id'));
|
||||
|
@@ -40,7 +40,8 @@ class AccountId extends BasicConverter implements ConverterInterface
|
||||
return new Account;
|
||||
}
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found account in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -43,7 +43,8 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
|
@@ -43,7 +43,8 @@ class AssetAccountName extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
|
@@ -41,7 +41,8 @@ class AssetAccountNumber extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
|
@@ -42,7 +42,8 @@ class BillId extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var BillRepositoryInterface $repository */
|
||||
$repository = app(BillRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(BillRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found bill in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -44,7 +44,8 @@ class BillName extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var BillRepositoryInterface $repository */
|
||||
$repository = app(BillRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(BillRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found bill in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -42,7 +42,8 @@ class BudgetId extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var BudgetRepositoryInterface $repository */
|
||||
$repository = app(BudgetRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(BudgetRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found budget in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -42,7 +42,8 @@ class BudgetName extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var BudgetRepositoryInterface $repository */
|
||||
$repository = app(BudgetRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(BudgetRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found budget in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -42,7 +42,8 @@ class CategoryId extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var CategoryRepositoryInterface $repository */
|
||||
$repository = app(CategoryRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(CategoryRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found category in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -42,7 +42,8 @@ class CategoryName extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var CategoryRepositoryInterface $repository */
|
||||
$repository = app(CategoryRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(CategoryRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found category in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -36,6 +36,7 @@ class CurrencyCode extends BasicConverter implements ConverterInterface
|
||||
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -42,7 +42,8 @@ class CurrencyId extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -42,7 +42,8 @@ class CurrencyName extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -42,7 +42,8 @@ class CurrencySymbol extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
|
||||
|
@@ -43,7 +43,8 @@ class OpposingAccountIban extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
|
@@ -42,7 +42,8 @@ class OpposingAccountName extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
|
@@ -43,7 +43,8 @@ class OpposingAccountNumber extends BasicConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
|
||||
if (isset($this->mapping[$value])) {
|
||||
|
@@ -39,7 +39,8 @@ class TagSplit
|
||||
Log::debug('Exploded parts.', $parts);
|
||||
|
||||
/** @var TagRepositoryInterface $repository */
|
||||
$repository = app(TagRepositoryInterface::class, [$user]);
|
||||
$repository = app(TagRepositoryInterface::class);
|
||||
$repository->setUser($user);
|
||||
|
||||
|
||||
/** @var string $part */
|
||||
|
@@ -58,7 +58,8 @@ class ImportProcedure implements ImportProcedureInterface
|
||||
if ($job->configuration['import-account'] != 0) {
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$job->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($job->user);
|
||||
$validator->setDefaultImportAccount($repository->find($job->configuration['import-account']));
|
||||
}
|
||||
|
||||
|
@@ -159,7 +159,8 @@ class ImportStorage
|
||||
private function createImportTag(): Tag
|
||||
{
|
||||
/** @var TagRepositoryInterface $repository */
|
||||
$repository = app(TagRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(TagRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
$data = [
|
||||
'tag' => trans('firefly.import_with_key', ['key' => $this->job->key]),
|
||||
'date' => new Carbon,
|
||||
|
@@ -177,7 +177,8 @@ class ImportValidator
|
||||
// find it first by new type:
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
$result = $repository->findByName($account->name, [$type]);
|
||||
if (is_null($result->id)) {
|
||||
@@ -214,7 +215,8 @@ class ImportValidator
|
||||
{
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
$name = 'Unknown expense account';
|
||||
$result = $repository->findByName($name, [AccountType::EXPENSE]);
|
||||
@@ -235,7 +237,8 @@ class ImportValidator
|
||||
{
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
|
||||
$name = 'Unknown revenue account';
|
||||
$result = $repository->findByName($name, [AccountType::REVENUE]);
|
||||
@@ -382,7 +385,8 @@ class ImportValidator
|
||||
{
|
||||
if (is_null($entry->fields['currency'])) {
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class, [$this->user]);
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$repository->setUser($this->user);
|
||||
// is the default currency for the user or the system
|
||||
$defaultCode = Preferences::getForUser($this->user, 'currencyPreference', config('firefly.default_currency', 'EUR'))->data;
|
||||
|
||||
|
@@ -181,7 +181,8 @@ class CsvSetup implements SetupInterface
|
||||
public function saveImportConfiguration(array $data, FileBag $files): bool
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class, [auth()->user()]);
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$repository->setUser(auth()->user());
|
||||
|
||||
$importId = $data['csv_import_account'] ?? 0;
|
||||
$account = $repository->find(intval($importId));
|
||||
|
@@ -156,7 +156,8 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue
|
||||
protected function collectJournals()
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAccounts($this->accounts)->setRange($this->startDate, $this->endDate);
|
||||
|
||||
return $collector->getJournals();
|
||||
|
@@ -442,7 +442,8 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
public function spentInPeriod(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setBudgets($budgets);
|
||||
|
||||
if ($accounts->count() > 0) {
|
||||
@@ -468,7 +469,8 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
public function spentInPeriodWoBudget(Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->withoutBudget();
|
||||
|
||||
if ($accounts->count() > 0) {
|
||||
|
@@ -57,7 +57,8 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
public function earnedInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setAccounts($accounts)->setCategories($categories);
|
||||
$set = $collector->getJournals();
|
||||
$sum = strval($set->sum('transaction_amount'));
|
||||
@@ -393,7 +394,8 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
public function spentInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setCategories($categories);
|
||||
|
||||
|
||||
@@ -421,7 +423,8 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
public function spentInPeriodWithoutCategory(Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->withoutCategory();
|
||||
|
||||
if ($accounts->count() > 0) {
|
||||
|
@@ -394,7 +394,8 @@ class TagRepository implements TagRepositoryInterface
|
||||
public function earnedInPeriod(Tag $tag, Carbon $start, Carbon $end): string
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setAllAssetAccounts()->setTag($tag);
|
||||
$set = $collector->getJournals();
|
||||
$sum = strval($set->sum('transaction_amount'));
|
||||
@@ -412,7 +413,8 @@ class TagRepository implements TagRepositoryInterface
|
||||
public function spentInPeriod(Tag $tag, Carbon $start, Carbon $end): string
|
||||
{
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setAllAssetAccounts()->setTag($tag);
|
||||
$set = $collector->getJournals();
|
||||
$sum = strval($set->sum('transaction_amount'));
|
||||
|
@@ -50,7 +50,8 @@ class SetBudget implements ActionInterface
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
/** @var BudgetRepositoryInterface $repository */
|
||||
$repository = app(BudgetRepositoryInterface::class, [$journal->user]);
|
||||
$repository = app(BudgetRepositoryInterface::class);
|
||||
$repository->setUser($journal->user);
|
||||
$search = $this->action->action_value;
|
||||
$budgets = $repository->getActiveBudgets();
|
||||
$budget = $budgets->filter(
|
||||
|
@@ -60,7 +60,8 @@ class SetDestinationAccount implements ActionInterface
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$this->journal = $journal;
|
||||
$this->repository = app(AccountRepositoryInterface::class, [$journal->user]);
|
||||
$this->repository = app(AccountRepositoryInterface::class);
|
||||
$this->repository->setUser($journal->user);
|
||||
$count = $journal->transactions()->count();
|
||||
if ($count > 2) {
|
||||
Log::error(sprintf('Cannot change destination account of journal #%d because it is a split journal.', $journal->id));
|
||||
|
@@ -60,7 +60,8 @@ class SetSourceAccount implements ActionInterface
|
||||
public function act(TransactionJournal $journal): bool
|
||||
{
|
||||
$this->journal = $journal;
|
||||
$this->repository = app(AccountRepositoryInterface::class, [$journal->user]);
|
||||
$this->repository = app(AccountRepositoryInterface::class);
|
||||
$this->repository->setUser($journal->user);
|
||||
$count = $journal->transactions()->count();
|
||||
if ($count > 2) {
|
||||
Log::error(sprintf('Cannot change source account of journal #%d because it is a split journal.', $journal->id));
|
||||
|
@@ -78,7 +78,8 @@ class TransactionMatcher
|
||||
do {
|
||||
// Fetch a batch of transactions from the database
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser(auth()->user());
|
||||
$collector->setAllAssetAccounts()->setLimit($pageSize)->setPage($page)->setTypes($this->transactionTypes);
|
||||
$set = $collector->getPaginatedJournals();
|
||||
Log::debug(sprintf('Found %d journals to check. ', $set->count()));
|
||||
|
@@ -37,16 +37,6 @@ class Search implements SearchInterface
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* AttachmentRepository constructor.
|
||||
*
|
||||
* @param User $user
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* The search will assume that the user does not have so many accounts
|
||||
* that this search should be paginated.
|
||||
@@ -164,7 +154,8 @@ class Search implements SearchInterface
|
||||
$result = new Collection();
|
||||
do {
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setAllAssetAccounts()->setLimit($pageSize)->setPage($page);
|
||||
$set = $collector->getPaginatedJournals();
|
||||
Log::debug(sprintf('Found %d journals to check. ', $set->count()));
|
||||
@@ -222,6 +213,14 @@ class Search implements SearchInterface
|
||||
$this->limit = $limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*/
|
||||
public function setUser(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $haystack
|
||||
* @param array $needle
|
||||
|
@@ -13,6 +13,7 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Support\Search;
|
||||
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -29,6 +30,11 @@ interface SearchInterface
|
||||
*/
|
||||
public function searchAccounts(array $words): Collection;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*/
|
||||
public function setUser(User $user);
|
||||
|
||||
/**
|
||||
* @param array $words
|
||||
*
|
||||
|
Reference in New Issue
Block a user