2016-09-02 22:00:42 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\AlbumSources;
|
|
|
|
|
|
|
|
use App\Album;
|
|
|
|
use App\Photo;
|
2016-09-28 20:13:18 +01:00
|
|
|
use App\Storage;
|
2016-10-28 12:59:36 +01:00
|
|
|
use Guzzle\Http\EntityBody;
|
2016-09-02 22:00:42 +01:00
|
|
|
|
|
|
|
interface IAlbumSource
|
|
|
|
{
|
2016-09-09 11:09:03 +01:00
|
|
|
/**
|
|
|
|
* 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);
|
2016-09-03 22:13:05 +01:00
|
|
|
|
2016-09-24 09:34:08 +01:00
|
|
|
/**
|
2016-10-28 12:59:36 +01:00
|
|
|
* 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 EntityBody
|
2016-09-24 09:34:08 +01:00
|
|
|
*/
|
2016-10-28 12:59:36 +01:00
|
|
|
function fetchPhotoContent(Photo $photo, $thumbnail = null);
|
2016-09-24 09:34:08 +01:00
|
|
|
|
2020-04-18 21:51:28 +01:00
|
|
|
/**
|
|
|
|
* Gets the configuration of the source.
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
function getConfiguration();
|
|
|
|
|
2016-09-02 22:18:40 +01:00
|
|
|
/**
|
2016-10-28 12:59:36 +01:00
|
|
|
* Gets the name of this album source.
|
2016-09-02 22:18:40 +01:00
|
|
|
* @return string
|
|
|
|
*/
|
2016-10-28 12:59:36 +01:00
|
|
|
function getName();
|
2016-09-02 22:00:42 +01:00
|
|
|
|
2016-09-03 22:13:05 +01:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2016-09-08 23:22:29 +01:00
|
|
|
function getUrlToPhoto(Photo $photo, $thumbnail = null);
|
2016-09-03 22:13:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Saves a generated thumbnail to its permanent location.
|
2016-10-28 12:59:36 +01:00
|
|
|
* @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.)
|
2016-09-03 22:13:05 +01:00
|
|
|
* @return mixed
|
|
|
|
*/
|
2016-10-28 12:59:36 +01:00
|
|
|
function saveThumbnail(Photo $photo, $tempFilename, $thumbnail = null);
|
2016-09-28 20:13:18 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param Album $album
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
function setAlbum(Album $album);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param Storage $configuration
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
function setConfiguration(Storage $configuration);
|
2016-09-02 22:00:42 +01:00
|
|
|
}
|