74 lines
1.9 KiB
PHP
74 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\AlbumSources;
|
|
|
|
use App\Album;
|
|
use App\Photo;
|
|
use App\Storage;
|
|
use GuzzleHttp\Psr7\Stream;
|
|
|
|
interface IAlbumSource
|
|
{
|
|
/**
|
|
* Deletes an entire album's media contents.
|
|
* @return void
|
|
*/
|
|
function deleteAlbumContents();
|
|
|
|
/**
|
|
* Deletes a thumbnail file for a photo.
|
|
* @param Photo $photo Photo to delete the thumbnail from.
|
|
* @param string $thumbnail Thumbnail to delete (or null to delete the original.)
|
|
* @return void
|
|
*/
|
|
function deleteThumbnail(Photo $photo, $thumbnail = null);
|
|
|
|
/**
|
|
* Fetches the contents of a thumbnail for a photo.
|
|
* @param Photo $photo Photo to fetch the thumbnail for.
|
|
* @param string $thumbnail Thumbnail to fetch (or null to fetch the original.)
|
|
* @return Stream
|
|
*/
|
|
function fetchPhotoContent(Photo $photo, $thumbnail = null);
|
|
|
|
/**
|
|
* Gets the configuration of the source.
|
|
* @return mixed
|
|
*/
|
|
function getConfiguration();
|
|
|
|
/**
|
|
* Gets the name of this album source.
|
|
* @return string
|
|
*/
|
|
function getName();
|
|
|
|
/**
|
|
* Gets the absolute URL to the given photo file.
|
|
* @param Photo $photo Photo to get the URL to.
|
|
* @param string $thumbnail Thumbnail to get the image to.
|
|
* @return string
|
|
*/
|
|
function getUrlToPhoto(Photo $photo, $thumbnail = null);
|
|
|
|
/**
|
|
* Saves a generated thumbnail to its permanent location.
|
|
* @param Photo $photo Photo the image relates to.
|
|
* @param string $tempFilename Filename containing the image.
|
|
* @param string $thumbnail Name of the thumbnail (or null for the original.)
|
|
* @return mixed
|
|
*/
|
|
function saveThumbnail(Photo $photo, $tempFilename, $thumbnail = null);
|
|
|
|
/**
|
|
* @param Album $album
|
|
* @return mixed
|
|
*/
|
|
function setAlbum(Album $album);
|
|
|
|
/**
|
|
* @param Storage $configuration
|
|
* @return mixed
|
|
*/
|
|
function setConfiguration(Storage $configuration);
|
|
} |