Decryption routine for #671

This commit is contained in:
James Cole
2017-07-30 08:22:39 +02:00
parent eac9613df7
commit 2694ce4148
4 changed files with 148 additions and 0 deletions

View File

@@ -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
*/

View File

@@ -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
*/