firefly-iii/app/Helpers/Attachments/AttachmentHelperInterface.php

72 lines
1.8 KiB
PHP
Raw Normal View History

2015-07-18 02:49:29 -05:00
<?php
/**
* AttachmentHelperInterface.php
2017-10-21 01:40:00 -05:00
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
2017-10-21 01:40:00 -05:00
* This file is part of Firefly III.
*
2017-10-21 01:40:00 -05:00
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2017-12-17 07:41:58 -06:00
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
2017-03-24 09:15:12 -05:00
declare(strict_types=1);
2015-07-18 02:49:29 -05:00
namespace FireflyIII\Helpers\Attachments;
2015-07-18 14:32:31 -05:00
use FireflyIII\Models\Attachment;
2015-07-18 02:49:29 -05:00
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
2015-07-18 02:49:29 -05:00
use Illuminate\Support\MessageBag;
/**
2017-11-15 05:25:49 -06:00
* Interface AttachmentHelperInterface.
2015-07-18 02:49:29 -05:00
*/
interface AttachmentHelperInterface
{
/**
2016-01-19 06:59:54 -06:00
* @param Attachment $attachment
2015-07-18 02:49:29 -05:00
*
2016-02-18 00:21:48 -06:00
* @return string
2015-07-18 02:49:29 -05:00
*/
2016-02-18 00:21:48 -06:00
public function getAttachmentLocation(Attachment $attachment): string;
2015-07-18 02:49:29 -05:00
/**
* @param Attachment $attachment
*
* @return string
*/
public function getAttachmentContent(Attachment $attachment): string;
/**
* @return Collection
*/
public function getAttachments(): Collection;
2015-07-18 02:49:29 -05:00
/**
* @return MessageBag
*/
2016-02-18 00:21:48 -06:00
public function getErrors(): MessageBag;
2015-07-18 02:49:29 -05:00
/**
* @return MessageBag
*/
2016-02-18 00:21:48 -06:00
public function getMessages(): MessageBag;
2015-07-18 02:49:29 -05:00
2015-07-18 14:32:31 -05:00
/**
2017-03-24 09:15:12 -05:00
* @param Model $model
2017-02-25 10:39:50 -06:00
* @param null|array $files
2017-02-24 22:57:01 -06:00
*
2016-01-19 06:59:54 -06:00
* @return bool
2015-07-18 14:32:31 -05:00
*/
2017-07-23 12:06:24 -05:00
public function saveAttachmentsForModel(Model $model, ?array $files): bool;
2015-07-19 02:38:44 -05:00
}