mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
Remove methods, point to interface.
This commit is contained in:
@@ -30,9 +30,6 @@ use FireflyIII\Models\Location;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -148,10 +145,6 @@ interface AccountRepositoryInterface
|
||||
|
||||
public function searchAccountNr(string $query, array $types, int $limit): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
public function store(array $data): Account;
|
||||
|
||||
public function update(Account $account, array $data): Account;
|
||||
|
@@ -24,8 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\Account;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -38,6 +36,4 @@ interface AccountTaskerInterface
|
||||
public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): array;
|
||||
|
||||
public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
}
|
||||
|
@@ -26,8 +26,6 @@ namespace FireflyIII\Repositories\Account;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -49,8 +47,6 @@ interface OperationsRepositoryInterface
|
||||
*/
|
||||
public function listIncome(Carbon $start, Carbon $end, ?Collection $accounts = null): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* Sum of withdrawal journals in period for a set of accounts, grouped per currency. Amounts are always negative.
|
||||
*
|
||||
|
@@ -25,8 +25,6 @@ namespace FireflyIII\Repositories\Attachment;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Attachment;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -47,8 +45,6 @@ interface AttachmentRepositoryInterface
|
||||
*/
|
||||
public function getNoteText(Attachment $attachment): ?string;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
|
@@ -26,9 +26,6 @@ namespace FireflyIII\Repositories\Bill;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
@@ -41,8 +38,6 @@ interface BillRepositoryInterface
|
||||
|
||||
public function billStartsWith(string $query, int $limit): Collection;
|
||||
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
/**
|
||||
* Add correct order to bills.
|
||||
*/
|
||||
@@ -141,8 +136,6 @@ interface BillRepositoryInterface
|
||||
*/
|
||||
public function setOrder(Bill $bill, int $order): void;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
|
@@ -27,8 +27,6 @@ namespace FireflyIII\Repositories\Budget;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\AvailableBudget;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -86,8 +84,6 @@ interface AvailableBudgetRepositoryInterface
|
||||
*/
|
||||
public function setAvailableBudget(TransactionCurrency $currency, Carbon $start, Carbon $end, string $amount): AvailableBudget;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function store(array $data): ?AvailableBudget;
|
||||
|
||||
public function update(AvailableBudget $availableBudget, array $data): AvailableBudget;
|
||||
|
@@ -28,8 +28,6 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -68,8 +66,6 @@ interface BudgetLimitRepositoryInterface
|
||||
|
||||
public function setNoteText(BudgetLimit $budgetLimit, string $text): void;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function store(array $data): BudgetLimit;
|
||||
|
||||
public function update(BudgetLimit $budgetLimit, array $data): BudgetLimit;
|
||||
|
@@ -27,9 +27,6 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\AutoBudget;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -41,8 +38,6 @@ interface BudgetRepositoryInterface
|
||||
|
||||
public function budgetStartsWith(string $query, int $limit): Collection;
|
||||
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
/**
|
||||
* Returns the amount that is budgeted in a period.
|
||||
*/
|
||||
@@ -102,8 +97,6 @@ interface BudgetRepositoryInterface
|
||||
|
||||
public function setBudgetOrder(Budget $budget, int $order): void;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* Used in the v2 API to calculate the amount of money spent in all active budgets.
|
||||
*/
|
||||
|
@@ -26,8 +26,6 @@ namespace FireflyIII\Repositories\Budget;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -40,7 +38,5 @@ interface NoBudgetRepositoryInterface
|
||||
*/
|
||||
public function getNoBudgetPeriodReport(Collection $accounts, Carbon $start, Carbon $end): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function sumExpenses(Carbon $start, Carbon $end, ?Collection $accounts = null, ?TransactionCurrency $currency = null): array;
|
||||
}
|
||||
|
@@ -27,8 +27,6 @@ namespace FireflyIII\Repositories\Budget;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -54,8 +52,6 @@ interface OperationsRepositoryInterface
|
||||
*/
|
||||
public function listExpenses(Carbon $start, Carbon $end, ?Collection $accounts = null, ?Collection $budgets = null): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* @SuppressWarnings("PHPMD.ExcessiveParameterList")
|
||||
*/
|
||||
|
@@ -26,9 +26,6 @@ namespace FireflyIII\Repositories\Category;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -87,10 +84,6 @@ interface CategoryRepositoryInterface
|
||||
|
||||
public function searchCategory(string $query, int $limit): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
|
@@ -25,8 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\Category;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -48,8 +46,6 @@ interface NoCategoryRepositoryInterface
|
||||
*/
|
||||
public function listIncome(Carbon $start, Carbon $end, ?Collection $accounts = null): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* Sum of withdrawal journals in period without a category, grouped per currency. Amounts are always negative.
|
||||
*/
|
||||
|
@@ -25,8 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\Category;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -64,8 +62,6 @@ interface OperationsRepositoryInterface
|
||||
*/
|
||||
public function listTransferredOut(Carbon $start, Carbon $end, Collection $accounts, ?Collection $categories = null): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* Sum of withdrawal journals in period for a set of categories, grouped per currency. Amounts are always negative.
|
||||
*/
|
||||
|
@@ -26,9 +26,6 @@ namespace FireflyIII\Repositories\Currency;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\CurrencyExchangeRate;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -66,8 +63,4 @@ interface CurrencyRepositoryInterface
|
||||
* Used in download exchange rate cron job. Needs the user object!
|
||||
*/
|
||||
public function setExchangeRate(TransactionCurrency $fromCurrency, TransactionCurrency $toCurrency, Carbon $date, float $rate): CurrencyExchangeRate;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
}
|
||||
|
@@ -26,8 +26,6 @@ namespace FireflyIII\Repositories\Journal;
|
||||
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -54,6 +52,4 @@ interface JournalAPIRepositoryInterface
|
||||
* Get all piggy bank events for a journal.
|
||||
*/
|
||||
public function getPiggyBankEvents(TransactionJournal $journal): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
}
|
||||
|
@@ -26,8 +26,6 @@ namespace FireflyIII\Repositories\Journal;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -80,6 +78,4 @@ interface JournalCLIRepositoryInterface
|
||||
* Return all tags as strings in an array.
|
||||
*/
|
||||
public function getTags(TransactionJournal $journal): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
}
|
||||
|
@@ -29,8 +29,6 @@ use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionJournalLink;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -98,8 +96,6 @@ interface JournalRepositoryInterface
|
||||
*/
|
||||
public function searchJournalDescriptions(string $search, int $limit): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* TODO Maybe to account repository? Do this wen reconcile is API only.
|
||||
*/
|
||||
|
@@ -26,8 +26,6 @@ namespace FireflyIII\Repositories\LinkType;
|
||||
use FireflyIII\Models\LinkType;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionJournalLink;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -72,8 +70,6 @@ interface LinkTypeRepositoryInterface
|
||||
*/
|
||||
public function getLinks(TransactionJournal $journal): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function store(array $data): LinkType;
|
||||
|
||||
/**
|
||||
|
@@ -25,8 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\ObjectGroup;
|
||||
|
||||
use FireflyIII\Models\ObjectGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -61,7 +59,5 @@ interface ObjectGroupRepositoryInterface
|
||||
|
||||
public function setOrder(ObjectGroup $objectGroup, int $newOrder): ObjectGroup;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function update(ObjectGroup $objectGroup, array $data): ObjectGroup;
|
||||
}
|
||||
|
@@ -29,9 +29,6 @@ use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\PiggyBank;
|
||||
use FireflyIII\Models\PiggyBankRepetition;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -41,8 +38,6 @@ interface PiggyBankRepositoryInterface
|
||||
{
|
||||
public function addAmount(PiggyBank $piggyBank, Account $account, string $amount, ?TransactionJournal $journal = null): bool;
|
||||
|
||||
public function getCurrentNativeAmount(PiggyBank $piggyBank, ?Account $account = null): string;
|
||||
|
||||
public function addAmountToPiggyBank(PiggyBank $piggyBank, string $amount, TransactionJournal $journal): void;
|
||||
|
||||
public function canAddAmount(PiggyBank $piggyBank, Account $account, string $amount): bool;
|
||||
@@ -72,6 +67,8 @@ interface PiggyBankRepositoryInterface
|
||||
*/
|
||||
public function getCurrentAmount(PiggyBank $piggyBank, ?Account $account = null): string;
|
||||
|
||||
public function getCurrentNativeAmount(PiggyBank $piggyBank, ?Account $account = null): string;
|
||||
|
||||
/**
|
||||
* Get all events.
|
||||
*/
|
||||
@@ -136,10 +133,6 @@ interface PiggyBankRepositoryInterface
|
||||
*/
|
||||
public function setOrder(PiggyBank $piggyBank, int $newOrder): bool;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
/**
|
||||
* Store new piggy bank.
|
||||
*
|
||||
|
@@ -29,8 +29,6 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\RecurrenceRepetition;
|
||||
use FireflyIII\Models\RecurrenceTransaction;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
@@ -137,8 +135,6 @@ interface RecurringRepositoryInterface
|
||||
|
||||
public function searchRecurrence(string $query, int $limit): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* Store a new recurring transaction.
|
||||
*
|
||||
|
@@ -27,8 +27,6 @@ use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\Models\RuleTrigger;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -84,8 +82,6 @@ interface RuleRepositoryInterface
|
||||
|
||||
public function setOrder(Rule $rule, int $newOrder): void;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function store(array $data): Rule;
|
||||
|
||||
public function storeAction(Rule $rule, array $values): RuleAction;
|
||||
|
@@ -24,8 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\RuleGroup;
|
||||
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -88,8 +86,6 @@ interface RuleGroupRepositoryInterface
|
||||
|
||||
public function setOrder(RuleGroup $ruleGroup, int $newOrder): void;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function store(array $data): RuleGroup;
|
||||
|
||||
public function update(RuleGroup $ruleGroup, array $data): RuleGroup;
|
||||
|
@@ -25,8 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\Tag;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -48,8 +46,6 @@ interface OperationsRepositoryInterface
|
||||
*/
|
||||
public function listIncome(Carbon $start, Carbon $end, ?Collection $accounts = null, ?Collection $tags = null): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* Sum of withdrawal journals in period for a set of tags, grouped per currency. Amounts are always negative.
|
||||
*/
|
||||
|
@@ -26,8 +26,6 @@ namespace FireflyIII\Repositories\Tag;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Location;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -93,8 +91,6 @@ interface TagRepositoryInterface
|
||||
*/
|
||||
public function searchTags(string $query, int $limit): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
/**
|
||||
* This method stores a tag.
|
||||
*/
|
||||
|
@@ -28,10 +28,7 @@ use FireflyIII\Exceptions\DuplicateTransactionException;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Location;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\Support\NullArrayObject;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -98,10 +95,6 @@ interface TransactionGroupRepositoryInterface
|
||||
*/
|
||||
public function getTags(int $journalId): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
/**
|
||||
* Create a new transaction group.
|
||||
*
|
||||
|
@@ -25,8 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\UserGroup;
|
||||
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -44,8 +42,6 @@ interface UserGroupRepositoryInterface
|
||||
|
||||
public function getMembershipsFromGroupId(int $groupId): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function store(array $data): UserGroup;
|
||||
|
||||
public function update(UserGroup $userGroup, array $data): UserGroup;
|
||||
|
@@ -27,8 +27,6 @@ namespace FireflyIII\Repositories\Webhook;
|
||||
use FireflyIII\Models\Webhook;
|
||||
use FireflyIII\Models\WebhookAttempt;
|
||||
use FireflyIII\Models\WebhookMessage;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -53,8 +51,6 @@ interface WebhookRepositoryInterface
|
||||
|
||||
public function getReadyMessages(Webhook $webhook): Collection;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function store(array $data): Webhook;
|
||||
|
||||
public function update(Webhook $webhook, array $data): Webhook;
|
||||
|
45
app/Support/Repositories/UserGroup/UserGroupInterface.php
Normal file
45
app/Support/Repositories/UserGroup/UserGroupInterface.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* UserGroupInterface.php
|
||||
* Copyright (c) 2025 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Repositories\UserGroup;
|
||||
|
||||
use FireflyIII\Enums\UserRoleEnum;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
|
||||
interface UserGroupInterface
|
||||
{
|
||||
public function getUserGroup(): ?UserGroup;
|
||||
|
||||
public function getUser(): ?User;
|
||||
|
||||
public function checkUserGroupAccess(UserRoleEnum $role): bool;
|
||||
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
|
||||
public function setUserGroupById(int $userGroupId): void;
|
||||
}
|
@@ -40,11 +40,16 @@ trait UserGroupTrait
|
||||
protected ?User $user = null;
|
||||
protected ?UserGroup $userGroup = null;
|
||||
|
||||
public function getUserGroup(): UserGroup
|
||||
public function getUserGroup(): ?UserGroup
|
||||
{
|
||||
return $this->userGroup;
|
||||
}
|
||||
|
||||
public function getUser(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function checkUserGroupAccess(UserRoleEnum $role): bool
|
||||
{
|
||||
$result = $this->user->hasRoleInGroupOrOwner($this->userGroup, $role);
|
||||
|
Reference in New Issue
Block a user