Documentation

Album
in package

Album service.

Table of Contents

Properties

$aclService  : AclService
$albumCoverService  : AlbumCover
$albumForm  : Album
$albumMapper  : Album
$memberService  : Member
$photoService  : Photo
$storageService  : FileStorage
$tagMapper  : Tag
$translator  : Translator
$weeklyPhotoMapper  : WeeklyPhoto

Methods

__construct()  : mixed
createAlbum()  : Album
Creates a new album.
deleteAlbum()  : void
Removes an album and all subalbums recursively, including all photos.
deleteAlbumCover()  : void
Deletes the file belonging to the album cover for an album.
generateAlbumCover()  : string|null
Updates the given album with a newly generated cover photo.
getAlbum()  : MemberAlbum|Album|WeeklyAlbum|null
Gets an album using the album id.
getAlbumForm()  : Album
Retrieves the form for editing the specified album.
getAlbums()  : array<string|int, Album>
Retrieves all the albums in the root directory or in the specified album.
getAlbumsByMember()  : array<string|int, array{album_id: int}>
Get all unique albums a certain member is tagged in
getAlbumsByYear()  : array<string|int, Album>
Returns all albums for a given association year.
getAlbumsWithoutDate()  : array<string|int, Album>
Retrieves all root albums which do not have a startDateTime specified.
getAlbumYears()  : array<string|int, int>
Gets a list of all association years of which photos are available.
getLastPhotosOfTheWeekPerYear()  : array<string|int, WeeklyPhoto>
Retrieves all WeeklyPhotos.
moveAlbum()  : bool
Moves an album to new parent album.
movePhoto()  : bool
Moves a photo to a new album.
updateAlbum()  : bool
Updates the metadata of an album using post data.
getMemberAlbum()  : MemberAlbum|null
getWeeklyAlbum()  : WeeklyAlbum|null

Properties

$tagMapper read-only

private Tag $tagMapper

$translator read-only

private Translator $translator

Methods

__construct()

public __construct(AclService $aclService, Translator $translator, Photo $photoService, AlbumCover $albumCoverService, Member $memberService, FileStorage $storageService, Album $albumMapper, Tag $tagMapper, WeeklyPhoto $weeklyPhotoMapper, Album $albumForm) : mixed
Parameters
$aclService : AclService
$translator : Translator
$photoService : Photo
$albumCoverService : AlbumCover
$memberService : Member
$storageService : FileStorage
$albumMapper : Album
$tagMapper : Tag
$weeklyPhotoMapper : WeeklyPhoto
$albumForm : Album

createAlbum()

Creates a new album.

public createAlbum(int|null $parentId, array<string|int, mixed> $data) : Album
Parameters
$parentId : int|null

the id of the parent album

$data : array<string|int, mixed>

The post data to use for the album

Tags
throws
Exception
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
Album

deleteAlbum()

Removes an album and all subalbums recursively, including all photos.

public deleteAlbum(int $albumId) : void
Parameters
$albumId : int

the id of the album to remove

Tags
throws
Exception

deleteAlbumCover()

Deletes the file belonging to the album cover for an album.

public deleteAlbumCover(Album $album) : void
Parameters
$album : Album

generateAlbumCover()

Updates the given album with a newly generated cover photo.

public generateAlbumCover(int $albumId) : string|null
Parameters
$albumId : int
Tags
throws
Exception
Return values
string|null

getAlbum()

Gets an album using the album id.

public getAlbum(int $albumId[, string $type = 'album' ]) : MemberAlbum|Album|WeeklyAlbum|null
Parameters
$albumId : int

the id of the album

$type : string = 'album'

"album"|"member"|"weekly"

Tags
throws
Exception

If there are no sufficient permissions.

Return values
MemberAlbum|Album|WeeklyAlbum|null

album matching the given id

getAlbumForm()

Retrieves the form for editing the specified album.

public getAlbumForm([int|null $albumId = null ]) : Album
Parameters
$albumId : int|null = null

of the album

Tags
throws
Exception
Return values
Album

getAlbums()

Retrieves all the albums in the root directory or in the specified album.

public getAlbums([Album|null $album = null ][, int $start = 0 ][, int|null $maxResults = null ]) : array<string|int, Album>
Parameters
$album : Album|null = null

The album to retrieve sub-albums of

$start : int = 0

the result to start at

$maxResults : int|null = null

max amount of results to return, null for infinite

Return values
array<string|int, Album>

getAlbumsByMember()

Get all unique albums a certain member is tagged in

public getAlbumsByMember(int $lidnr) : array<string|int, array{album_id: int}>
Parameters
$lidnr : int
Return values
array<string|int, array{album_id: int}>

getAlbumsByYear()

Returns all albums for a given association year.

public getAlbumsByYear(int $year[, bool $onlyPublished = true ]) : array<string|int, Album>

In this context an association year is defined as the year which contains the first day of the association year.

Example: A value of 2010 would represent the association year 2010/2011

Parameters
$year : int

the year in which the albums have been created

$onlyPublished : bool = true

whether to only retrieve published albums or all albums

Return values
array<string|int, Album>

getAlbumsWithoutDate()

Retrieves all root albums which do not have a startDateTime specified.

public getAlbumsWithoutDate() : array<string|int, Album>

This is in most cases analogous to returning all empty albums.

Return values
array<string|int, Album>

getAlbumYears()

Gets a list of all association years of which photos are available.

public getAlbumYears([bool $onlyPublished = true ]) : array<string|int, int>

In this context an association year is defined as the year which contains the first day of the association year.

Example: A value of 2010 would represent the association year 2010/2011

Parameters
$onlyPublished : bool = true
Return values
array<string|int, int>

representing years

getLastPhotosOfTheWeekPerYear()

Retrieves all WeeklyPhotos.

public getLastPhotosOfTheWeekPerYear() : array<string|int, WeeklyPhoto>
Return values
array<string|int, WeeklyPhoto>

moveAlbum()

Moves an album to new parent album.

public moveAlbum(int $albumId, int|null $parentId) : bool
Parameters
$albumId : int

the id of the album to be moved

$parentId : int|null

the id of the new parent or null if the album should not be a subalbum

Tags
throws
Exception
Return values
bool

indicating if the move was successful

movePhoto()

Moves a photo to a new album.

public movePhoto(int $photoId, int $albumId) : bool
Parameters
$photoId : int

the id of the photo

$albumId : int

the id of the new album

Tags
throws
Exception
Return values
bool

indicating whether move was successful

updateAlbum()

Updates the metadata of an album using post data.

public updateAlbum() : bool
Tags
throws
Exception
Return values
bool

indicating if the update was successful


        
On this page

Search results