mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-15 19:09:50 +00:00
Expand a few repositories to support user groups.
This commit is contained in:
@@ -38,6 +38,7 @@ use FireflyIII\Services\Internal\Destroy\BillDestroyService;
|
||||
use FireflyIII\Services\Internal\Update\BillUpdateService;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
@@ -51,8 +52,7 @@ use Illuminate\Support\Facades\Log;
|
||||
class BillRepository implements BillRepositoryInterface
|
||||
{
|
||||
use CreatesObjectGroups;
|
||||
|
||||
private User $user;
|
||||
use UserGroupTrait;
|
||||
|
||||
public function billEndsWith(string $query, int $limit): Collection
|
||||
{
|
||||
@@ -294,13 +294,6 @@ class BillRepository implements BillRepositoryInterface
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void
|
||||
{
|
||||
if ($user instanceof User) {
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
|
||||
public function getPaginator(int $size): LengthAwarePaginator
|
||||
{
|
||||
return $this->user->bills()
|
||||
|
||||
@@ -26,6 +26,7 @@ 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;
|
||||
@@ -39,6 +40,7 @@ interface BillRepositoryInterface
|
||||
public function billEndsWith(string $query, int $limit): Collection;
|
||||
|
||||
public function billStartsWith(string $query, int $limit): Collection;
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
/**
|
||||
* Add correct order to bills.
|
||||
|
||||
Reference in New Issue
Block a user