MetaFox

AlbumRepository extends AbstractRepository
in package
implements AlbumRepositoryInterface Uses HasFeatured, HasSponsor, HasApprove, CollectTotalItemStatTrait, UserMorphTrait, HasSponsorInFeed, FloodControlPhotoTrait

Class AlbumRepository.

Tags
mixin

UserMorphTrait;

SuppressWarnings

(PHPMD.CouplingBetweenObjects)

SuppressWarnings

(PHPMD.ExcessiveClassComplexity)

Table of Contents

Interfaces

AlbumRepositoryInterface
Interface Album.

Properties

$model  : Album
$disableSponsor  : mixed
$skipPresenter  : mixed

Methods

approve()  : bool
buildQueryScopes()  : mixed
cleanContent()  : string|null
cleanTitle()  : string|null
createAlbum()  : Album
createMany()  : bool
deleteAlbum()  : mixed
deleteAlbumAndPhotos()  : bool
deleteOwnerData()  : void
deleteUserData()  : void
disableSponsor()  : void
enableSponsor()  : void
feature()  : bool
find()  : Album
findFeature()  : Paginator
findSponsor()  : Paginator
getAlbumById()  : Album|null
getAlbumsForForm()  : array<int, mixed>
getDefaultUserAlbums()  : Collection
getModel()  : Album
getRandomSponsoredItems()  : Collection
getSponsoredItem()  : Content|null
getTotalItemByPeriod()  : int
getTotalPendingItemByPeriod()  : int
getUserContractMorphTypeColumns()  : array<string|int, string>
hasSponsorView()  : bool
isDefaultUserAlbum()  : bool
isFeature()  : bool
isFeedSponsored()  : bool
isNoSponsorView()  : bool
isPending()  : bool
isSponsor()  : bool
lazyDeleteWhere()  : void
likeOperator()  : string
return the case-insensitive LIKE operator bases on the current database driver.
model()  : string
removeAvatarFromAlbum()  : void
removeCoverFromAlbum()  : void
sponsor()  : bool
sponsorInFeed()  : bool
unsponsor()  : bool
unsponsorInFeed()  : bool
updateAlbum()  : Album
updateAlbumCover()  : void
uploadMedias()  : array<string|int, mixed>
viewAlbum()  : mixed
viewAlbumItems()  : Paginator
viewAlbums()  : Paginator
where()  : $this
withUserMorphTypeActiveScope()  : self
checkFloodControlWhenCreatePhoto()  : void
groupRepository()  : PhotoGroupRepositoryInterface
integratePhotoGroup()  : void
newPhotoGroup()  : PhotoGroup
queryAlbumForPrivacyMember()  : void
queryAlbumForUserProfile()  : void
removeAlbumItems()  : void
syncItemsWithAlbum()  : array<string|int, mixed>
uploadAlbumItems()  : array<string|int, mixed>
applyDisplayPhotoSetting()  : void
buildQueryAlbumItems()  : Builder
buildQueryViewAlbums()  : Builder
checkPhotoQuota()  : void
handleUploadStatistic()  : void

Properties

Methods

approve()

public approve(User $context, int $id) : bool
Parameters
$context : User
$id : int
Tags
throws
AuthorizationException
Return values
bool

buildQueryScopes()

public buildQueryScopes(mixed $query, mixed $model, mixed $criteria) : mixed
Parameters
$query : mixed
$model : mixed
$criteria : mixed

cleanContent()

public cleanContent(string|null $string) : string|null
Parameters
$string : string|null
Return values
string|null

cleanTitle()

public cleanTitle(string|null $string) : string|null
Parameters
$string : string|null
Return values
string|null

createMany()

public createMany(array<string|int, mixed> $items) : bool
Parameters
$items : array<string|int, mixed>
Return values
bool

feature()

public feature(User $context, int $id, int $feature) : bool
Parameters
$context : User
$id : int
$feature : int
Return values
bool

findFeature()

public findFeature([int $limit = 4 ]) : Paginator
Parameters
$limit : int = 4
Tags
todo

implement cache

Return values
Paginator

findSponsor()

public findSponsor([int $limit = 4 ]) : Paginator
Parameters
$limit : int = 4
Tags
todo

implement cache

Return values
Paginator

getAlbumsForForm()

public getAlbumsForForm(User $context, User $owner) : array<int, mixed>
Parameters
$context : User
$owner : User
Return values
array<int, mixed>

getDefaultUserAlbums()

public getDefaultUserAlbums(int $ownerId[, array<string|int, mixed> $types = [] ]) : Collection
Parameters
$ownerId : int
$types : array<string|int, mixed> = []
Return values
Collection

getRandomSponsoredItems()

public getRandomSponsoredItems(User $context, int $limit[, array<string|int, mixed>|null $loadedItemIds = null ]) : Collection
Parameters
$context : User
$limit : int
$loadedItemIds : array<string|int, mixed>|null = null
Return values
Collection

getSponsoredItem()

public getSponsoredItem(array<string|int, mixed> $notInIds[, int|null $sponsorStart = null ][, array<string|int, mixed> $with = [] ]) : Content|null
Parameters
$notInIds : array<string|int, mixed>
$sponsorStart : int|null = null
$with : array<string|int, mixed> = []
Return values
Content|null

getTotalItemByPeriod()

public getTotalItemByPeriod([Carbon|null $after = null ][, Carbon|null $before = null ]) : int
Parameters
$after : Carbon|null = null
$before : Carbon|null = null
Return values
int

getTotalPendingItemByPeriod()

public getTotalPendingItemByPeriod([Carbon|null $after = null ][, Carbon|null $before = null ][, array<string|int, mixed>|null $where = null ]) : int
Parameters
$after : Carbon|null = null
$before : Carbon|null = null
$where : array<string|int, mixed>|null = null
Return values
int

getUserContractMorphTypeColumns()

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

hasSponsorView()

public hasSponsorView(array<string|int, mixed> $attributes) : bool
Parameters
$attributes : array<string|int, mixed>
Return values
bool

isDefaultUserAlbum()

public isDefaultUserAlbum(int $id[, int $ownerId = 0 ]) : bool
Parameters
$id : int
$ownerId : int = 0
Return values
bool

isNoSponsorView()

public isNoSponsorView(string|null $view) : bool
Parameters
$view : string|null
Return values
bool

lazyDeleteWhere()

public lazyDeleteWhere([array<string|int, mixed> $where = [] ]) : void
Parameters
$where : array<string|int, mixed> = []

likeOperator()

return the case-insensitive LIKE operator bases on the current database driver.

public likeOperator() : string
Return values
string

sponsor()

public sponsor(User $context, int $id, int $sponsor) : bool
Parameters
$context : User
$id : int
$sponsor : int
Tags
throws
AuthenticationException
throws
AuthorizationException
Return values
bool

sponsorInFeed()

public sponsorInFeed(User $context, int $id, int $newValue) : bool
Parameters
$context : User
$id : int
$newValue : int
Tags
throws
AuthenticationException
throws
AuthorizationException
Return values
bool

unsponsor()

public unsponsor(User $context, int $id) : bool
Parameters
$context : User
$id : int
Return values
bool

unsponsorInFeed()

public unsponsorInFeed(User $context, int $id) : bool
Parameters
$context : User
$id : int
Return values
bool

updateAlbum()

public updateAlbum(User $context, int $id, array<string, mixed> $attributes) : Album
Parameters
$context : User
$id : int
$attributes : array<string, mixed>
Tags
throws
AuthorizationException
throws
Throwable
Return values
Album

updateAlbumCover()

public updateAlbumCover(Album $album[, int $photoId = 0 ]) : void
Parameters
$album : Album
$photoId : int = 0

uploadMedias()

public uploadMedias(User $context, int $id, array<string, mixed> $attributes) : array<string|int, mixed>
Parameters
$context : User
$id : int
$attributes : array<string, mixed>
Tags
throws
AuthorizationException
Return values
array<string|int, mixed>

viewAlbumItems()

public viewAlbumItems(User $context, int $id[, array<string|int, mixed> $attributes = [] ]) : Paginator
Parameters
$context : User
$id : int
$attributes : array<string|int, mixed> = []
Return values
Paginator

viewAlbums()

public viewAlbums(User $context, User $owner[, array<string|int, mixed> $attributes = [] ]) : Paginator
Parameters
$context : User
$owner : User
$attributes : array<string|int, mixed> = []
Return values
Paginator

where()

public where(array<string|int, mixed> $params) : $this
Parameters
$params : array<string|int, mixed>
Tags
throws
RepositoryException
Return values
$this

withUserMorphTypeActiveScope()

public withUserMorphTypeActiveScope() : self
Return values
self

checkFloodControlWhenCreatePhoto()

protected checkFloodControlWhenCreatePhoto(User $context, array<string|int, mixed> $params, string $key) : void
Parameters
$context : User
$params : array<string|int, mixed>
$key : string

queryAlbumForPrivacyMember()

protected queryAlbumForPrivacyMember(Builder $query[, User|null $owner = null ]) : void
Parameters
$query : Builder
$owner : User|null = null

queryAlbumForUserProfile()

protected queryAlbumForUserProfile(Builder $query, User $context, string $view, int $profileId) : void
Parameters
$query : Builder
$context : User
$view : string
$profileId : int

removeAlbumItems()

protected removeAlbumItems(array<int, mixed> $removeItems) : void
Parameters
$removeItems : array<int, mixed>

syncItemsWithAlbum()

protected syncItemsWithAlbum(User $context, Album $album, PhotoGroup|null $group, array<int, mixed> $updateItems) : array<string|int, mixed>
Parameters
$context : User
$album : Album
$group : PhotoGroup|null
$updateItems : array<int, mixed>
Return values
array<string|int, mixed>

uploadAlbumItems()

protected uploadAlbumItems(User $context, Album $album, PhotoGroup|null $group, array<int, array<string, mixed>> $newItems[, array<string, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
$context : User
$album : Album
$group : PhotoGroup|null
$newItems : array<int, array<string, mixed>>
$params : array<string, mixed> = []
Return values
array<string|int, mixed>

applyDisplayPhotoSetting()

private applyDisplayPhotoSetting(Builder $query, User $context, User $owner, array<string|int, mixed> $attributes) : void
Parameters
$query : Builder
$context : User
$owner : User
$attributes : array<string|int, mixed>

buildQueryAlbumItems()

private buildQueryAlbumItems(User $context, int $id, array<string, mixed> $attributes) : Builder
Parameters
$context : User
$id : int
$attributes : array<string, mixed>
Tags
throws
AuthorizationException
SuppressWarnings

(PHPMD.CyclomaticComplexity)

SuppressWarnings

(PHPMD.NPathComplexity)

SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
Builder

buildQueryViewAlbums()

private buildQueryViewAlbums(User $context, User $owner, array<string, mixed> $attributes) : Builder
Parameters
$context : User
$owner : User
$attributes : array<string, mixed>
Return values
Builder

checkPhotoQuota()

private checkPhotoQuota(User $context[, array<int, mixed> $newItems = [] ][, array<int, mixed> $removedItems = [] ]) : void
Parameters
$context : User
$newItems : array<int, mixed> = []
$removedItems : array<int, mixed> = []

handleUploadStatistic()

private handleUploadStatistic(array<string|int, mixed> $item, mixed $itemResult, array<string|int, mixed> &$statistic) : void
Parameters
$item : array<string|int, mixed>
$itemResult : mixed
$statistic : array<string|int, mixed>

        
On this page

Search results