Album
in package
Album service.
Table of Contents
Properties
- $aclService : AclService
- $albumCoverService : AlbumCover
- $albumForm : Album
- $albumMapper : Album
- $memberService : Member
- $photoService : Photo
- $searchAlbumForm : SearchAlbum
- $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.
- 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.
- getSearchAlbumForm() : SearchAlbum
- moveAlbum() : bool
- Moves an album to new parent album.
- movePhoto() : bool
- Moves a photo to a new album.
- search() : array<string|int, Album>
- Search for albums.
- updateAlbum() : bool
- Updates the metadata of an album using post data.
- getMemberAlbum() : MemberAlbum|null
- getWeeklyAlbum() : WeeklyAlbum|null
Properties
$aclService read-only
private
AclService
$aclService
$albumCoverService read-only
private
AlbumCover
$albumCoverService
$albumForm read-only
private
Album
$albumForm
$albumMapper read-only
private
Album
$albumMapper
$memberService read-only
private
Member
$memberService
$photoService read-only
private
Photo
$photoService
$searchAlbumForm read-only
private
SearchAlbum
$searchAlbumForm
$storageService read-only
private
FileStorage
$storageService
$tagMapper read-only
private
Tag
$tagMapper
$translator read-only
private
Translator
$translator
$weeklyPhotoMapper read-only
private
WeeklyPhoto
$weeklyPhotoMapper
Methods
__construct()
public
__construct(AclService $aclService, Translator $translator, Photo $photoService, AlbumCover $albumCoverService, Member $memberService, FileStorage $storageService, Album $albumMapper, Tag $tagMapper, WeeklyPhoto $weeklyPhotoMapper, Album $albumForm, SearchAlbum $searchAlbumForm) : mixed
Parameters
- $aclService : AclService
- $translator : Translator
- $photoService : Photo
- $albumCoverService : AlbumCover
- $memberService : Member
- $storageService : FileStorage
- $albumMapper : Album
- $tagMapper : Tag
- $weeklyPhotoMapper : WeeklyPhoto
- $albumForm : Album
- $searchAlbumForm : SearchAlbum
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
Return values
AlbumdeleteAlbum()
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
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
Return values
string|nullgetAlbum()
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
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
Return values
AlbumgetAlbumsByMember()
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>getSearchAlbumForm()
public
getSearchAlbumForm() : SearchAlbum
Return values
SearchAlbummoveAlbum()
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
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
Return values
bool —indicating whether move was successful
search()
Search for albums.
public
search(array<string|int, mixed> $data) : array<string|int, Album>
Parameters
- $data : array<string|int, mixed>
-
Search data
Tags
Return values
array<string|int, Album>updateAlbum()
Updates the metadata of an album using post data.
public
updateAlbum() : bool
Tags
Return values
bool —indicating if the update was successful
getMemberAlbum()
private
getMemberAlbum(int $lidNr) : MemberAlbum|null
Parameters
- $lidNr : int
Return values
MemberAlbum|nullgetWeeklyAlbum()
private
getWeeklyAlbum(int $year) : WeeklyAlbum|null
Parameters
- $year : int