mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Also delete attachments.
This commit is contained in:
@@ -29,4 +29,19 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
return $attachment;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(Attachment $attachment)
|
||||
{
|
||||
/** @var \FireflyIII\Helpers\Attachments\AttachmentHelperInterface $helper */
|
||||
$helper = app('FireflyIII\Helpers\Attachments\AttachmentHelperInterface');
|
||||
|
||||
$file = $helper->getAttachmentLocation($attachment);
|
||||
unlink($file);
|
||||
$attachment->delete();
|
||||
}
|
||||
}
|
||||
|
@@ -19,4 +19,12 @@ interface AttachmentRepositoryInterface
|
||||
* @return Attachment
|
||||
*/
|
||||
public function update(Attachment $attachment, array $attachmentData);
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(Attachment $attachment);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user