File: D:/HostingSpaces/SBogers10/werkenbij.komma.pro/app/Komma/Documents/Kms/DocumentServiceInterface.php
<?php
namespace App\Komma\Documents\Kms;
use App\Komma\Documents\Models\Document;
use App\Komma\Kms\Core\Attributes\Documents;
use App\Komma\Kms\Core\Sections\AbstractAttributeKey;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Collection;
/**
* Class DocumentService
*
* Manages uploads
*
* @package App\Komma\Documents\Kms
*/
interface DocumentServiceInterface
{
/**
* Retrieves the uploaded documents and stores them in the filesystem and database by delegating to other methods
*
* @param Model $model
* @param Documents $attribute
* @param AbstractAttributeKey $beforeSaveKey The key of the attribute before it was saved. If you don't specify it, the attribute key will be used.
* @param AbstractAttributeKey $afterSaveKey The key of the attribute after it was saved. If you don't specify it, the attribute key will be used.
*/
public function processUploadedDocumentsForModel(Model $model, Documents $attribute, AbstractAttributeKey $beforeSaveKey = null, AbstractAttributeKey $afterSaveKey = null);
/**
* Store an html 5 uploaded file
*
* @param UploadedFile $file
* @param string $subFolder the subfolder of the public uploads folder where to store this file
* @param array $imageProperties
* @return Document
*/
public function storeHtml5Upload(UploadedFile $file, string $subFolder, array $imageProperties): Document;
/**
* Deletes all documents for the model given
*
* @param DocumentableInterface|Document $model
*/
public function deleteDocumentsForModel($model);
/**
* Deletes the specified documents and their related files
*
* @param $documents
*/
public static function deleteDocuments(Collection $documents);
/**
* Uses the key (for example Documents-documents) to scan for uploaded documents by appending -1, -2, -3 etc to the key name.
* and then using the \Input facade to retrieve it. Then stores all the uploaded files in their corresponding Document models.
* Also gets the json version of all models in a form using $key input field, looks at those json versions state attributes
* and either gets them from the database or makes a new document.
*
* @param string $key
* @return Collection
*/
public function getDocumentsUsingAttributeKey(string $key):Collection;
}