Merge branch 'develop' into feature/rules-on-existing-transactions

This commit is contained in:
Robert Horlings
2016-02-23 13:17:07 +01:00
50 changed files with 408 additions and 239 deletions

View File

@@ -3,7 +3,9 @@ declare(strict_types = 1);
namespace FireflyIII\Repositories\Attachment;
use Auth;
use FireflyIII\Models\Attachment;
use Illuminate\Support\Collection;
/**
* Class AttachmentRepository
@@ -26,9 +28,18 @@ class AttachmentRepository implements AttachmentRepositoryInterface
$file = $helper->getAttachmentLocation($attachment);
unlink($file);
$attachment->delete();
return true;
}
/**
* @return Collection
*/
public function get(): Collection
{
return Auth::user()->attachments()->get();
}
/**
* @param Attachment $attachment
* @param array $data

View File

@@ -4,6 +4,7 @@ declare(strict_types = 1);
namespace FireflyIII\Repositories\Attachment;
use FireflyIII\Models\Attachment;
use Illuminate\Support\Collection;
/**
* Interface AttachmentRepositoryInterface
@@ -20,6 +21,11 @@ interface AttachmentRepositoryInterface
*/
public function destroy(Attachment $attachment): bool;
/**
* @return Collection
*/
public function get(): Collection;
/**
* @param Attachment $attachment
* @param array $attachmentData