mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Decryption routine for #671
This commit is contained in:
@@ -62,6 +62,36 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
return $disk->exists($attachment->fileName());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
public function find(int $id): Attachment
|
||||
{
|
||||
$attachment = $this->user->attachments()->find($id);
|
||||
if (is_null($attachment)) {
|
||||
return new Attachment;
|
||||
}
|
||||
|
||||
return $attachment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
public function findWithoutUser(int $id): Attachment
|
||||
{
|
||||
$attachment = Attachment::find($id);
|
||||
if (is_null($attachment)) {
|
||||
return new Attachment;
|
||||
}
|
||||
|
||||
return $attachment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
|
@@ -40,6 +40,20 @@ interface AttachmentRepositoryInterface
|
||||
*/
|
||||
public function exists(Attachment $attachment): bool;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
public function find(int $id): Attachment;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
public function findWithoutUser(int $id):Attachment;
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
|
Reference in New Issue
Block a user