AlbumRepository
extends AbstractRepository
in package
implements
AlbumRepositoryInterface
Uses
HasFeatured, HasSponsor, HasApprove, CollectTotalItemStatTrait, UserMorphTrait, HasSponsorInFeed, FloodControlPhotoTrait
Class AlbumRepository.
Tags
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
$model
public
Album
$model
$disableSponsor
protected
mixed
$disableSponsor
$skipPresenter
protected
mixed
$skipPresenter
= true
Methods
approve()
public
approve(User $context, int $id) : bool
Parameters
- $context : User
- $id : int
Tags
Return values
boolbuildQueryScopes()
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|nullcleanTitle()
public
cleanTitle(string|null $string) : string|null
Parameters
- $string : string|null
Return values
string|nullcreateAlbum()
public
createAlbum(User $context, User $owner, array<string|int, mixed> $attributes) : Album
Parameters
Tags
Return values
AlbumcreateMany()
public
createMany(array<string|int, mixed> $items) : bool
Parameters
- $items : array<string|int, mixed>
Return values
booldeleteAlbum()
public
deleteAlbum(User $context, int $id) : mixed
Parameters
- $context : User
- $id : int
deleteAlbumAndPhotos()
public
deleteAlbumAndPhotos(User $context, Album $album) : bool
Parameters
Return values
booldeleteOwnerData()
public
deleteOwnerData(User $user) : void
Parameters
- $user : User
deleteUserData()
public
deleteUserData(User $user) : void
Parameters
- $user : User
disableSponsor()
public
disableSponsor(Content $content) : void
Parameters
- $content : Content
enableSponsor()
public
enableSponsor(Content $content) : void
Parameters
- $content : Content
feature()
public
feature(User $context, int $id, int $feature) : bool
Parameters
- $context : User
- $id : int
- $feature : int
Return values
boolfind()
public
find(mixed $id, mixed $columns) : Album
Parameters
- $id : mixed
- $columns : mixed
Return values
AlbumfindFeature()
public
findFeature([int $limit = 4 ]) : Paginator
Parameters
- $limit : int = 4
Tags
Return values
PaginatorfindSponsor()
public
findSponsor([int $limit = 4 ]) : Paginator
Parameters
- $limit : int = 4
Tags
Return values
PaginatorgetAlbumById()
public
getAlbumById(int $id) : Album|null
Parameters
- $id : int
Return values
Album|nullgetAlbumsForForm()
public
getAlbumsForForm(User $context, User $owner) : array<int, mixed>
Parameters
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
CollectiongetModel()
public
getModel() : Album
Return values
AlbumgetRandomSponsoredItems()
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
CollectiongetSponsoredItem()
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|nullgetTotalItemByPeriod()
public
getTotalItemByPeriod([Carbon|null $after = null ][, Carbon|null $before = null ]) : int
Parameters
- $after : Carbon|null = null
- $before : Carbon|null = null
Return values
intgetTotalPendingItemByPeriod()
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
intgetUserContractMorphTypeColumns()
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
boolisDefaultUserAlbum()
public
isDefaultUserAlbum(int $id[, int $ownerId = 0 ]) : bool
Parameters
- $id : int
- $ownerId : int = 0
Return values
boolisFeature()
public
isFeature(Content $model) : bool
Parameters
- $model : Content
Return values
boolisFeedSponsored()
public
isFeedSponsored(Content $model) : bool
Parameters
- $model : Content
Return values
boolisNoSponsorView()
public
isNoSponsorView(string|null $view) : bool
Parameters
- $view : string|null
Return values
boolisPending()
public
isPending(Content $model) : bool
Parameters
- $model : Content
Return values
boolisSponsor()
public
isSponsor(Content $model) : bool
Parameters
- $model : Content
Tags
Return values
boollazyDeleteWhere()
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
stringmodel()
public
model() : string
Return values
stringremoveAvatarFromAlbum()
public
removeAvatarFromAlbum(Album $album, Photo $photo) : void
Parameters
removeCoverFromAlbum()
public
removeCoverFromAlbum(Album $album, Photo $photo) : void
Parameters
sponsor()
public
sponsor(User $context, int $id, int $sponsor) : bool
Parameters
- $context : User
- $id : int
- $sponsor : int
Tags
Return values
boolsponsorInFeed()
public
sponsorInFeed(User $context, int $id, int $newValue) : bool
Parameters
- $context : User
- $id : int
- $newValue : int
Tags
Return values
boolunsponsor()
public
unsponsor(User $context, int $id) : bool
Parameters
- $context : User
- $id : int
Return values
boolunsponsorInFeed()
public
unsponsorInFeed(User $context, int $id) : bool
Parameters
- $context : User
- $id : int
Return values
boolupdateAlbum()
public
updateAlbum(User $context, int $id, array<string, mixed> $attributes) : Album
Parameters
- $context : User
- $id : int
- $attributes : array<string, mixed>
Tags
Return values
AlbumupdateAlbumCover()
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
Return values
array<string|int, mixed>viewAlbum()
public
viewAlbum(User $context, int $id) : mixed
Parameters
- $context : User
- $id : int
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
PaginatorviewAlbums()
public
viewAlbums(User $context, User $owner[, array<string|int, mixed> $attributes = [] ]) : Paginator
Parameters
Return values
Paginatorwhere()
public
where(array<string|int, mixed> $params) : $this
Parameters
- $params : array<string|int, mixed>
Tags
Return values
$thiswithUserMorphTypeActiveScope()
public
withUserMorphTypeActiveScope() : self
Return values
selfcheckFloodControlWhenCreatePhoto()
protected
checkFloodControlWhenCreatePhoto(User $context, array<string|int, mixed> $params, string $key) : void
Parameters
- $context : User
- $params : array<string|int, mixed>
- $key : string
groupRepository()
protected
groupRepository() : PhotoGroupRepositoryInterface
Return values
PhotoGroupRepositoryInterfaceintegratePhotoGroup()
protected
integratePhotoGroup(PhotoGroup|null $group) : void
Parameters
- $group : PhotoGroup|null
newPhotoGroup()
protected
newPhotoGroup(array<string, mixed> $groupParams) : PhotoGroup
Parameters
- $groupParams : array<string, mixed>
Return values
PhotoGroupqueryAlbumForPrivacyMember()
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
buildQueryAlbumItems()
private
buildQueryAlbumItems(User $context, int $id, array<string, mixed> $attributes) : Builder
Parameters
- $context : User
- $id : int
- $attributes : array<string, mixed>
Tags
Return values
BuilderbuildQueryViewAlbums()
private
buildQueryViewAlbums(User $context, User $owner, array<string, mixed> $attributes) : Builder
Parameters
Return values
BuildercheckPhotoQuota()
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>