Documentation

Admin
in package

Admin service for all photo admin related functions.

Table of Contents

Properties

$aclService  : AclService
$metadataService  : Metadata
$photoMapper  : Photo
$photoService  : Photo
$storageService  : FileStorage
$translator  : Translator

Methods

__construct()  : mixed
checkUploadAllowed()  : void
Checks if the current user is allowed to upload photos.
storeUploadedPhoto()  : bool|Photo
Move the uploaded photo to the storage and store it in the database.
upload()  : void
createThumbnail()  : string
Creates and stores a thumbnail of specified maximum size from a stored image.

Properties

$translator read-only

private Translator $translator

Methods

checkUploadAllowed()

Checks if the current user is allowed to upload photos.

public checkUploadAllowed() : void

storeUploadedPhoto()

Move the uploaded photo to the storage and store it in the database.

public storeUploadedPhoto(string $path, Album $targetAlbum[, bool $move = false ]) : bool|Photo

All upload actions should use this function to prevent "ghost" files or database entries.

Parameters
$path : string

the temporary path of the uploaded photo

$targetAlbum : Album

the album to save the photo in

$move : bool = false

whether to move the photo instead of copying it

Return values
bool|Photo

upload()

public upload(array<string|int, mixed> $files, Album $album) : void
Parameters
$files : array<string|int, mixed>
$album : Album
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

createThumbnail()

Creates and stores a thumbnail of specified maximum size from a stored image.

protected createThumbnail(string $path, int $width, int $height) : string
Parameters
$path : string

the path of the original image

$width : int

the maximum width of the thumbnail (in px)

$height : int

the maximum height of the thumbnail (in px)

Return values
string

the path of the created thumbnail


        
On this page

Search results