Files
firefly-iii/app/Repositories/Attachment/AttachmentRepositoryInterface.php

91 lines
1.8 KiB
PHP
Raw Normal View History

2015-07-19 09:37:28 +02:00
<?php
/**
* AttachmentRepositoryInterface.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* 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.
*/
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;
use FireflyIII\User;
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-12-25 12:23:36 +01:00
/**
* @param Attachment $attachment
*
* @return bool
*/
public function exists(Attachment $attachment): bool;
2017-07-30 08:22:39 +02:00
/**
* @param int $id
*
* @return Attachment
*/
public function find(int $id): Attachment;
/**
* @param int $id
*
* @return Attachment
*/
2017-08-12 07:47:42 +02:00
public function findWithoutUser(int $id): Attachment;
2017-07-30 08:22:39 +02:00
2016-12-25 12:23:36 +01:00
/**
2016-12-30 13:47:23 +01:00
* @return Collection
2016-12-25 12:23:36 +01:00
*/
2016-12-30 13:47:23 +01:00
public function get(): Collection;
2016-12-25 12:23:36 +01:00
2016-10-23 09:44:14 +02:00
/**
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function getBetween(Carbon $start, Carbon $end): Collection;
2016-12-30 13:47:23 +01:00
/**
* @param Attachment $attachment
*
* @return string
*/
public function getContent(Attachment $attachment): string;
2017-01-30 16:46:30 +01:00
/**
* @param User $user
*/
public function setUser(User $user);
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