mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Adapted attachment repository.
This commit is contained in:
parent
d9eb14d6e5
commit
13bac92a24
@ -45,7 +45,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function __construct(User $user)
|
public function __construct(User $user)
|
||||||
{
|
{
|
||||||
Log::debug('Constructed for user #' . $user->id . ' (' . $user->email . ')');
|
Log::debug('Constructed account repository for user #' . $user->id . ' (' . $user->email . ')');
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,9 +3,10 @@ declare(strict_types = 1);
|
|||||||
|
|
||||||
namespace FireflyIII\Repositories\Attachment;
|
namespace FireflyIII\Repositories\Attachment;
|
||||||
|
|
||||||
use Auth;
|
|
||||||
use FireflyIII\Models\Attachment;
|
use FireflyIII\Models\Attachment;
|
||||||
|
use FireflyIII\User;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AttachmentRepository
|
* Class AttachmentRepository
|
||||||
@ -14,6 +15,19 @@ use Illuminate\Support\Collection;
|
|||||||
*/
|
*/
|
||||||
class AttachmentRepository implements AttachmentRepositoryInterface
|
class AttachmentRepository implements AttachmentRepositoryInterface
|
||||||
{
|
{
|
||||||
|
/** @var User */
|
||||||
|
private $user;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AttachmentRepository constructor.
|
||||||
|
*
|
||||||
|
* @param User $user
|
||||||
|
*/
|
||||||
|
public function __construct(User $user)
|
||||||
|
{
|
||||||
|
Log::debug('Constructed attachment repository for user #' . $user->id . ' (' . $user->email . ')');
|
||||||
|
$this->user = $user;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Attachment $attachment
|
* @param Attachment $attachment
|
||||||
@ -37,7 +51,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function get(): Collection
|
public function get(): Collection
|
||||||
{
|
{
|
||||||
return Auth::user()->attachments()->get();
|
return $this->user->attachments()->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user