2015-07-19 09:37:28 +02:00
|
|
|
<?php
|
2016-05-20 12:41:23 +02:00
|
|
|
/**
|
|
|
|
* AttachmentRepositoryInterface.php
|
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
|
|
*
|
2016-10-05 06:52:15 +02:00
|
|
|
* This software may be modified and distributed under the terms of the
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
|
|
|
*
|
|
|
|
* See the LICENSE file for details.
|
2016-05-20 12:41:23 +02:00
|
|
|
*/
|
|
|
|
|
2016-02-05 12:08:25 +01:00
|
|
|
declare(strict_types = 1);
|
2015-07-19 09:37:28 +02:00
|
|
|
|
|
|
|
namespace FireflyIII\Repositories\Attachment;
|
|
|
|
|
2016-10-23 09:44:14 +02:00
|
|
|
use Carbon\Carbon;
|
2015-07-19 09:37:28 +02:00
|
|
|
use FireflyIII\Models\Attachment;
|
2016-02-23 06:39:01 +01:00
|
|
|
use Illuminate\Support\Collection;
|
2015-07-19 09:37:28 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface AttachmentRepositoryInterface
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Repositories\Attachment
|
|
|
|
*/
|
|
|
|
interface AttachmentRepositoryInterface
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param Attachment $attachment
|
|
|
|
*
|
2015-07-26 15:51:07 +02:00
|
|
|
* @return bool
|
2015-07-19 09:37:28 +02:00
|
|
|
*/
|
2016-02-06 18:59:48 +01:00
|
|
|
public function destroy(Attachment $attachment): bool;
|
2015-07-19 09:53:58 +02:00
|
|
|
|
2016-02-23 06:39:01 +01:00
|
|
|
/**
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function get(): Collection;
|
|
|
|
|
2016-12-25 12:23:36 +01:00
|
|
|
/**
|
|
|
|
* @param Attachment $attachment
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function exists(Attachment $attachment): bool;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param Attachment $attachment
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getContent(Attachment $attachment): string;
|
|
|
|
|
2016-10-23 09:44:14 +02:00
|
|
|
/**
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function getBetween(Carbon $start, Carbon $end): Collection;
|
|
|
|
|
2015-07-19 09:53:58 +02:00
|
|
|
/**
|
|
|
|
* @param Attachment $attachment
|
2015-07-26 15:51:07 +02:00
|
|
|
* @param array $attachmentData
|
2015-07-19 09:53:58 +02:00
|
|
|
*
|
2015-07-26 15:51:07 +02:00
|
|
|
* @return Attachment
|
2015-07-19 09:53:58 +02:00
|
|
|
*/
|
2016-02-06 18:59:48 +01:00
|
|
|
public function update(Attachment $attachment, array $attachmentData): Attachment;
|
2015-07-19 09:38:44 +02:00
|
|
|
}
|
2015-07-19 09:53:58 +02:00
|
|
|
|