PinPostManager
extends StreamManager
in package
Class StreamManager.
Table of Contents
Properties
- $allowSortFields : array<string, array<string, string|null>>
- $select : array<string|int, string>
- $sortMapping : array<string, string>
- $isGreaterThanLastFeed : bool
- $isViewSearchString : bool
- $searchString : string|null
- $additionalConditions : array<string, mixed>
- $continuousTry : int
- $eagerLoads : array<string|int, string>
- $hashtag : string|null
- $isPreviewTag : bool
- $isViewHashtag : bool
- $isViewOnProfile : bool
- $limit : int
- $loadedSponsoredFeedIds : array<string|int, mixed>|null
- $onlyFriends : bool
- $ownerId : int|null
- $pinnedFeedIds : array<string|int, mixed>
- $searchByStreamId : bool
- $sortFields : array<string, mixed>
- $sortType : string
- $sortView : string
- $sponsoredFeedIds : array<string|int, mixed>
- $status : array<string|int, mixed>|null
- $user : User|null
- $userId : int|null
Methods
- __construct() : mixed
- addPinnedFeedIds() : mixed
- addSponsoredFeed() : void
- fetchPinnedFeeds() : void
- Fetch pinned feed into a collections when prepend to collection, we need to keep ordering of lasted pined at first.
- fetchSponsoredFeeds() : array<string|int, mixed>
- fetchStream() : Collection
- fetchStreamContinuous() : void
- getEagerLoads() : array<string|int, mixed>
- getFeedSortView() : array<string|int, mixed>
- getHomepageLimit() : int
- getIsGreaterThanLastFeed() : bool
- getLimit() : int
- getOwnerId() : int|null
- getPinnedFeedIds() : array<string|int, mixed>
- getProfileLimit() : int
- getSelect() : array<string|int, string>
- getSortFields() : array<string, mixed>
- getSortType() : string
- getSortView() : string
- getSponsoredFeedLimit() : int
- getStatus() : string
- getUserId() : int|null
- hasAdditionalConditions() : bool
- isApproved() : StreamManager
- isDenied() : StreamManager
- isOnlyFriends() : bool
- isPending() : StreamManager
- isPreviewTag() : int
- isRemoved() : StreamManager
- isSearchByStreamId() : bool
- isViewHashtag() : bool
- isViewOnProfile() : bool
- isViewSearch() : bool
- setAdditionalConditions() : StreamManager
- setHashtag() : StreamManager
- setIsGreaterThanLastFeed() : $this
- setIsViewHashtag() : StreamManager
- setIsViewOnProfile() : StreamManager
- setIsViewSearch() : $this
- setLimit() : self
- setLoadedSponsoredFeedIds() : $this
- setOnlyFriends() : $this
- setOwnerId() : self
- setPreviewTag() : $this
- setSearchByStreamId() : StreamManager
- setSearchString() : $this
- setSelect() : self
- setSortFields() : self
- setStatus() : StreamManager
- setUser() : $this
- setUserId() : self
- toFeeds() : Collection
- Convert from get stream (feed ids) to collection of Feeds.
- buildProfileQueryForMember() : Builder
- buildProfileQueryForModeration() : Builder
- buildQuery() : Builder|null
- buildQueryForFriendsOnly() : void
- queryHomeFeed() : Builder
- queryProfileFeed() : Builder
- handleAdditionalConditions() : Builder
Properties
$allowSortFields
public
array<string, array<string, string|null>>
$allowSortFields
= [
\MetaFox\Platform\Support\Browse\Browse::SORT_RECENT => ['stream.created_at' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC, 'stream.feed_id' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC],
\MetaFox\Platform\Support\Browse\Browse::SORT_MOST_DISCUSSED => ['feed.total_comment' => null, 'stream.updated_at' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC, 'stream.feed_id' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC],
\MetaFox\Platform\Support\Browse\Browse::SORT_MOST_VIEWED => ['feed.total_view' => null, 'stream.updated_at' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC, 'stream.feed_id' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC],
\MetaFox\Platform\Support\Browse\Browse::SORT_MOST_LIKED => ['feed.total_like' => null, 'stream.updated_at' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC, 'stream.feed_id' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC],
// @todo: TBD for sorting rule
\MetaFox\Platform\Support\Browse\Browse::SORT_TOP_STORIES => ['stream.updated_at' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC, 'feed.total_comment' => null, 'feed.total_like' => null, 'stream.feed_id' => \MetaFox\Platform\MetaFoxConstant::SORT_DESC],
]
$select
public
array<string|int, string>
$select
= [
// 'stream.id',
'stream.feed_id',
'stream.updated_at',
]
$sortMapping
public
array<string, string>
$sortMapping
= ['stream.feed_id' => 'id', 'stream.updated_at' => 'updated_at', 'feed.total_like' => 'total_like', 'feed.total_comment' => 'total_comment', 'feed.total_view' => 'total_view', 'stream.created_at' => 'created_at']
$isGreaterThanLastFeed
protected
bool
$isGreaterThanLastFeed
= false
$isViewSearchString
protected
bool
$isViewSearchString
= false
$searchString
protected
string|null
$searchString
= null
$additionalConditions
private
array<string, mixed>
$additionalConditions
= null
| array<int, mixed> |null
$continuousTry
private
int
$continuousTry
= 1
$eagerLoads
private
array<string|int, string>
$eagerLoads
= []
$hashtag
private
string|null
$hashtag
= null
$isPreviewTag
private
bool
$isPreviewTag
= false
$isViewHashtag
private
bool
$isViewHashtag
= false
$isViewOnProfile
private
bool
$isViewOnProfile
= false
$limit
private
int
$limit
= \MetaFox\Platform\Support\Helper\Pagination::DEFAULT_ITEM_PER_PAGE
$loadedSponsoredFeedIds
private
array<string|int, mixed>|null
$loadedSponsoredFeedIds
= null
$onlyFriends
private
bool
$onlyFriends
$ownerId
private
int|null
$ownerId
$pinnedFeedIds
private
array<string|int, mixed>
$pinnedFeedIds
= []
$searchByStreamId
private
bool
$searchByStreamId
= false
$sortFields
private
array<string, mixed>
$sortFields
$sortType
private
string
$sortType
$sortView
private
string
$sortView
$sponsoredFeedIds
private
array<string|int, mixed>
$sponsoredFeedIds
= []
$status
private
array<string|int, mixed>|null
$status
= null
$user
private
User|null
$user
= null
$userId
private
int|null
$userId
Methods
__construct()
public
__construct() : mixed
addPinnedFeedIds()
public
addPinnedFeedIds(Collection $collection) : mixed
Parameters
- $collection : Collection
addSponsoredFeed()
public
addSponsoredFeed(Collection $collection) : void
Parameters
- $collection : Collection
fetchPinnedFeeds()
Fetch pinned feed into a collections when prepend to collection, we need to keep ordering of lasted pined at first.
public
fetchPinnedFeeds() : void
So we need to sort out ordering in a right way, then collection just keep ordering only.
fetchSponsoredFeeds()
public
fetchSponsoredFeeds([array<string|int, mixed>|null $loadedSponsoredFeedIds = null ]) : array<string|int, mixed>
Parameters
- $loadedSponsoredFeedIds : array<string|int, mixed>|null = null
Return values
array<string|int, mixed>fetchStream()
public
fetchStream([int|null $lastFeedId = null ][, string|null $timeFrom = null ][, string|null $timeTo = null ]) : Collection
Parameters
- $lastFeedId : int|null = null
- $timeFrom : string|null = null
- $timeTo : string|null = null
Return values
CollectionfetchStreamContinuous()
public
fetchStreamContinuous(Collection $result, int $need, int|null $lastFeedId, int $try) : void
Parameters
- $result : Collection
- $need : int
- $lastFeedId : int|null
- $try : int
Tags
getEagerLoads()
public
getEagerLoads() : array<string|int, mixed>
Return values
array<string|int, mixed>getFeedSortView()
public
getFeedSortView() : array<string|int, mixed>
Return values
array<string|int, mixed>getHomepageLimit()
public
getHomepageLimit() : int
Return values
intgetIsGreaterThanLastFeed()
public
getIsGreaterThanLastFeed() : bool
Return values
boolgetLimit()
public
getLimit() : int
Return values
intgetOwnerId()
public
getOwnerId() : int|null
Return values
int|nullgetPinnedFeedIds()
public
getPinnedFeedIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getProfileLimit()
public
getProfileLimit() : int
Return values
intgetSelect()
public
getSelect() : array<string|int, string>
Return values
array<string|int, string>getSortFields()
public
getSortFields() : array<string, mixed>
Return values
array<string, mixed>getSortType()
public
getSortType() : string
Return values
stringgetSortView()
public
getSortView() : string
Return values
stringgetSponsoredFeedLimit()
public
getSponsoredFeedLimit() : int
Return values
intgetStatus()
public
getStatus() : string
Return values
stringgetUserId()
public
getUserId() : int|null
Return values
int|nullhasAdditionalConditions()
public
hasAdditionalConditions() : bool
Return values
boolisApproved()
public
isApproved() : StreamManager
Return values
StreamManagerisDenied()
public
isDenied() : StreamManager
Return values
StreamManagerisOnlyFriends()
public
isOnlyFriends() : bool
Return values
boolisPending()
public
isPending() : StreamManager
Return values
StreamManagerisPreviewTag()
public
isPreviewTag() : int
Return values
intisRemoved()
public
isRemoved() : StreamManager
Return values
StreamManagerisSearchByStreamId()
public
isSearchByStreamId() : bool
Return values
boolisViewHashtag()
public
isViewHashtag() : bool
Return values
boolisViewOnProfile()
public
isViewOnProfile() : bool
Return values
boolisViewSearch()
public
isViewSearch() : bool
Return values
boolsetAdditionalConditions()
public
setAdditionalConditions(array<string|int, mixed> $additionalConditions) : StreamManager
Parameters
- $additionalConditions : array<string|int, mixed>
Return values
StreamManagersetHashtag()
public
setHashtag(string $hashtag) : StreamManager
Parameters
- $hashtag : string
Return values
StreamManagersetIsGreaterThanLastFeed()
public
setIsGreaterThanLastFeed([bool $value = true ]) : $this
Parameters
- $value : bool = true
Return values
$thissetIsViewHashtag()
public
setIsViewHashtag(bool $isViewHashtag) : StreamManager
Parameters
- $isViewHashtag : bool
Return values
StreamManagersetIsViewOnProfile()
public
setIsViewOnProfile(bool $isViewOnProfile) : StreamManager
Parameters
- $isViewOnProfile : bool
Return values
StreamManagersetIsViewSearch()
public
setIsViewSearch(bool $isViewSearch) : $this
Parameters
- $isViewSearch : bool
Return values
$thissetLimit()
public
setLimit(int $limit) : self
Parameters
- $limit : int
Return values
selfsetLoadedSponsoredFeedIds()
public
setLoadedSponsoredFeedIds(array<string|int, mixed>|null $ids) : $this
Parameters
- $ids : array<string|int, mixed>|null
Return values
$thissetOnlyFriends()
public
setOnlyFriends(bool $onlyFriends) : $this
Parameters
- $onlyFriends : bool
Return values
$thissetOwnerId()
public
setOwnerId(int $ownerId) : self
Parameters
- $ownerId : int
Return values
selfsetPreviewTag()
public
setPreviewTag(bool $isPreviewTag) : $this
Parameters
- $isPreviewTag : bool
Return values
$thissetSearchByStreamId()
public
setSearchByStreamId(bool $value) : StreamManager
Parameters
- $value : bool
Return values
StreamManagersetSearchString()
public
setSearchString(string $search) : $this
Parameters
- $search : string
Return values
$thissetSelect()
public
setSelect(array<string|int, string> $select) : self
Parameters
- $select : array<string|int, string>
Return values
selfsetSortFields()
public
setSortFields(string $view[, string $sortType = MetaFoxConstant::SORT_DESC ]) : self
Parameters
- $view : string
- $sortType : string = MetaFoxConstant::SORT_DESC
Return values
selfsetStatus()
public
setStatus([string $status = null ]) : StreamManager
Parameters
- $status : string = null
Return values
StreamManagersetUser()
public
setUser(User $user) : $this
Parameters
- $user : User
Return values
$thissetUserId()
public
setUserId(int $userId) : self
Parameters
- $userId : int
Return values
selftoFeeds()
Convert from get stream (feed ids) to collection of Feeds.
public
toFeeds(array<string|int, int> $feedIds) : Collection
Parameters
- $feedIds : array<string|int, int>
Return values
CollectionbuildProfileQueryForMember()
protected
buildProfileQueryForMember(bool|null $isFriendOfFriend) : Builder
Parameters
- $isFriendOfFriend : bool|null
Return values
BuilderbuildProfileQueryForModeration()
protected
buildProfileQueryForModeration() : Builder
Return values
BuilderbuildQuery()
protected
buildQuery([int|null $lastFeedId = null ][, string|null $timeFrom = null ][, string|null $timeTo = null ]) : Builder|null
Parameters
- $lastFeedId : int|null = null
- $timeFrom : string|null = null
- $timeTo : string|null = null
Tags
Return values
Builder|nullbuildQueryForFriendsOnly()
protected
buildQueryForFriendsOnly(Builder $query) : void
Parameters
- $query : Builder
queryHomeFeed()
protected
queryHomeFeed() : Builder
Return values
BuilderqueryProfileFeed()
protected
queryProfileFeed() : Builder
Return values
BuilderhandleAdditionalConditions()
private
handleAdditionalConditions(Builder $query, array<string|int, mixed> $conditions) : Builder
Parameters
- $query : Builder
- $conditions : array<string|int, mixed>