Documentation

Photo
in package

Photo service.

Table of Contents

Properties

$aclService  : AclService
$memberService  : Member
$photoConfig  : array<string|int, mixed>
$photoMapper  : Photo
$profilePhotoMapper  : ProfilePhoto
$storageService  : FileStorage
$tagMapper  : Tag
$translator  : Translator
$voteMapper  : Vote
$weeklyPhotoMapper  : WeeklyPhoto

Methods

__construct()  : mixed
addTag()  : Tag|null
Tags a user in the specified photo.
countVote()  : void
Count a vote for the specified photo.
deletePhoto()  : bool
Removes a photo from the database and deletes its files, including thumbs from the server.
deletePhotoFile()  : bool
Deletes a stored photo at a given path.
deletePhotoFiles()  : void
Deletes all files associated with a photo.
determinePhotoOfTheWeek()  : Photo|null
Determine which photo is the photo of the week.
findTag()  : Tag|null
Retrieves a tag if it exists.
generatePhotoOfTheWeek()  : WeeklyPhoto|null
Generates the PhotoOfTheWeek and adds it to the list if at least one photo has been viewed in the specified time.
getBaseDirectory()  : string
Gets the base directory from which the photo paths should be requested.
getCurrentPhotoOfTheWeek()  : WeeklyPhoto|null
getPhoto()  : Photo|null
Retrieves a photo by an id.
getPhotoDownload()  : Stream|null
Returns a Laminas response to be used for downloading a photo.
getPhotoFileName()  : string
Returns a unique file name for a photo.
getPhotos()  : array<string|int, Photo>
Get all photos in an album.
getProfilePhoto()  : Photo|null
Determine which photo is best suited as profile picture.
getTagsForMember()  : array<string|int, Tag>
Gets all photos in which a member has been tagged.
hasExplicitProfilePhoto()  : bool
hasRecentVote()  : bool
Checks if the currently logged-in user has recently voted for a photo.
isTaggedIn()  : bool
Checks whether a user is tagged in a photo.
ratePhoto()  : float|int
Determine the preference rating of the photo.
ratePhotoForMember()  : float|int
Determine the preference rating of the photo.
removeProfilePhoto()  : void
removeTag()  : bool
Removes a tag.
setProfilePhoto()  : void
cacheProfilePhoto()  : void
determineProfilePhoto()  : Photo|null
getStoredProfilePhoto()  : ProfilePhoto|null
Determine which photo is best suited as profile picture.
storeProfilePhoto()  : void

Properties

$photoConfig read-only

private array<string|int, mixed> $photoConfig

$tagMapper read-only

private Tag $tagMapper

$translator read-only

private Translator $translator

Methods

__construct()

public __construct(AclService $aclService, Translator $translator, Member $memberService, FileStorage $storageService, Photo $photoMapper, Tag $tagMapper, Vote $voteMapper, WeeklyPhoto $weeklyPhotoMapper, ProfilePhoto $profilePhotoMapper, array<string|int, mixed> $photoConfig) : mixed
Parameters
$aclService : AclService
$translator : Translator
$memberService : Member
$storageService : FileStorage
$photoMapper : Photo
$tagMapper : Tag
$voteMapper : Vote
$weeklyPhotoMapper : WeeklyPhoto
$profilePhotoMapper : ProfilePhoto
$photoConfig : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

addTag()

Tags a user in the specified photo.

public addTag(int $photoId, int $lidnr) : Tag|null
Parameters
$photoId : int
$lidnr : int
Tags
throws
ORMException
Return values
Tag|null

countVote()

Count a vote for the specified photo.

public countVote(int $photoId) : void
Parameters
$photoId : int
Tags
throws
ORMException

deletePhoto()

Removes a photo from the database and deletes its files, including thumbs from the server.

public deletePhoto(int $photoId) : bool
Parameters
$photoId : int

the id of the photo to delete

Tags
throws
ORMException
Return values
bool

indicating whether the deletion was successful

deletePhotoFile()

Deletes a stored photo at a given path.

public deletePhotoFile(string $path) : bool
Parameters
$path : string
Return values
bool

indicated whether deleting the photo was successful

deletePhotoFiles()

Deletes all files associated with a photo.

public deletePhotoFiles(Photo $photo) : void
Parameters
$photo : Photo

determinePhotoOfTheWeek()

Determine which photo is the photo of the week.

public determinePhotoOfTheWeek(DateTime $beginDate, DateTime $endDate) : Photo|null
Parameters
$beginDate : DateTime
$endDate : DateTime
Tags
throws
Exception
Return values
Photo|null

findTag()

Retrieves a tag if it exists.

public findTag(int $photoId, int $lidnr) : Tag|null
Parameters
$photoId : int
$lidnr : int
Return values
Tag|null

generatePhotoOfTheWeek()

Generates the PhotoOfTheWeek and adds it to the list if at least one photo has been viewed in the specified time.

public generatePhotoOfTheWeek([DateTime|null $beginDate = null ][, DateTime|null $endDate = null ]) : WeeklyPhoto|null

The parameters determine the week to check the photos of.

Parameters
$beginDate : DateTime|null = null
$endDate : DateTime|null = null
Tags
throws
ORMException
throws
Exception
Return values
WeeklyPhoto|null

getBaseDirectory()

Gets the base directory from which the photo paths should be requested.

public getBaseDirectory() : string
Return values
string

getPhoto()

Retrieves a photo by an id.

public getPhoto(int $id) : Photo|null
Parameters
$id : int

the id of the album

Return values
Photo|null

photo matching the given id

getPhotoDownload()

Returns a Laminas response to be used for downloading a photo.

public getPhotoDownload(int $photoId) : Stream|null
Parameters
$photoId : int
Return values
Stream|null

getPhotoFileName()

Returns a unique file name for a photo.

public getPhotoFileName(Photo $photo) : string
Parameters
$photo : Photo

the photo to get a name for

Return values
string

getPhotos()

Get all photos in an album.

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

the album to get the photos from

$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, Photo>

getProfilePhoto()

Determine which photo is best suited as profile picture.

public getProfilePhoto(int $lidnr) : Photo|null
Parameters
$lidnr : int
Tags
throws
Exception
Return values
Photo|null

getTagsForMember()

Gets all photos in which a member has been tagged.

public getTagsForMember(Member $member) : array<string|int, Tag>
Parameters
$member : Member
Return values
array<string|int, Tag>

hasExplicitProfilePhoto()

public hasExplicitProfilePhoto(int $lidnr) : bool
Parameters
$lidnr : int
Tags
throws
Exception
Return values
bool

hasRecentVote()

Checks if the currently logged-in user has recently voted for a photo.

public hasRecentVote() : bool
Return values
bool

isTaggedIn()

Checks whether a user is tagged in a photo.

public isTaggedIn(int $photoId, int $lidnr) : bool
Parameters
$photoId : int
$lidnr : int
Return values
bool

ratePhoto()

Determine the preference rating of the photo.

public ratePhoto(Photo $photo, int $occurences) : float|int
Parameters
$photo : Photo
$occurences : int
Return values
float|int

ratePhotoForMember()

Determine the preference rating of the photo.

public ratePhotoForMember(Photo $photo) : float|int
Parameters
$photo : Photo
Return values
float|int

removeProfilePhoto()

public removeProfilePhoto([ProfilePhoto|null $profilePhoto = null ]) : void
Parameters
$profilePhoto : ProfilePhoto|null = null
Tags
throws
Exception

removeTag()

Removes a tag.

public removeTag(int $photoId, int $lidnr) : bool
Parameters
$photoId : int
$lidnr : int
Tags
throws
ORMException
Return values
bool

indicating whether removing the tag succeeded

setProfilePhoto()

public setProfilePhoto(int $photoId) : void
Parameters
$photoId : int
Tags
throws
ORMException

cacheProfilePhoto()

private cacheProfilePhoto(int $lidnr, Photo $photo) : void
Parameters
$lidnr : int
$photo : Photo
Tags
throws
ORMException

determineProfilePhoto()

private determineProfilePhoto(int $lidnr) : Photo|null
Parameters
$lidnr : int
Tags
throws
Exception
Return values
Photo|null

getStoredProfilePhoto()

Determine which photo is best suited as profile picture.

private getStoredProfilePhoto(int $lidnr) : ProfilePhoto|null
Parameters
$lidnr : int
Tags
throws
Exception
Return values
ProfilePhoto|null

storeProfilePhoto()

private storeProfilePhoto(Photo $photo, Member $member, DateTime $dateTime[, bool $explicit = false ]) : void
Parameters
$photo : Photo
$member : Member
$dateTime : DateTime
$explicit : bool = false
Tags
throws
ORMException

        
On this page

Search results