2016-09-02 22:00:42 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\AlbumSources;
|
|
|
|
|
|
|
|
use App\Album;
|
|
|
|
use App\Photo;
|
|
|
|
use Symfony\Component\HttpFoundation\File\File;
|
|
|
|
|
|
|
|
interface IAlbumSource
|
|
|
|
{
|
2016-09-03 22:13:05 +01:00
|
|
|
function getOriginalsFolder();
|
|
|
|
|
2016-09-02 22:18:40 +01:00
|
|
|
/**
|
2016-09-03 22:13:05 +01:00
|
|
|
* Gets the absolute path to the given photo file.
|
|
|
|
* @param Album $album Album containing the photo.
|
|
|
|
* @param Photo $photo Photo to get the path to.
|
|
|
|
* @param string $thumbnail Thumbnail to get the image to.
|
2016-09-02 22:18:40 +01:00
|
|
|
* @return string
|
|
|
|
*/
|
2016-09-04 21:59:32 +01:00
|
|
|
function getPathToPhoto(Album $album, Photo $photo, $thumbnail = null);
|
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 Album $album Album containing the photo.
|
|
|
|
* @param Photo $photo Photo to get the URL to.
|
|
|
|
* @param string $thumbnail Thumbnail to get the image to.
|
|
|
|
* @return string
|
|
|
|
*/
|
2016-09-04 21:59:32 +01:00
|
|
|
function getUrlToPhoto(Album $album, Photo $photo, $thumbnail = null);
|
2016-09-03 22:13:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Saves a generated thumbnail to its permanent location.
|
|
|
|
* @param Album $album Album containing the photo.
|
|
|
|
* @param Photo $photo Photo the thumbnail relates to.
|
|
|
|
* @param string $thumbnailInfo Information about the thumbnail.
|
|
|
|
* @param string $tempFilename Filename containing the thumbnail.
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
function saveThumbnail(Album $album, Photo $photo, $thumbnailInfo, $tempFilename);
|
2016-09-03 17:09:49 +01:00
|
|
|
|
2016-09-02 22:00:42 +01:00
|
|
|
/**
|
|
|
|
* Saves an uploaded file to the container and returns the filename.
|
|
|
|
* @param Album $album The album containing the photo
|
|
|
|
* @param File $uploadedFile The photo uploaded
|
|
|
|
* @return File
|
|
|
|
*/
|
|
|
|
function saveUploadedPhoto(Album $album, File $uploadedFile);
|
|
|
|
}
|