MessageCollection extends Collection implements RestConvertible, PopupDataAggregatable, DateFilterable uses ContextCustomer
Tags
Table of Contents
Interfaces
- RestConvertible
- PopupDataAggregatable
- An interface for classes that have entities within them that should be taken to the top level of a REST response.
- DateFilterable
Methods
- __construct() : mixed
- add() : static
- Append collection with new item.
- delete() : Result
- Delete from the database all entities that are in the registry and have an id
- fillAllForRest() : self
- fillFiles() : self
- fillParams() : self
- fillReactions() : self
- fillUnread() : self
- fillUrls() : self
- fillUuid() : self
- fillViewed() : self
- filter() : self
- filterByChatId() : self
- filterByDate() : FilterResult<string|int, static>
- find() : static
- getAny() : T|null
- getCollectionElementClass() : string
- Returns collection item's class name.
- getCommonChat() : Chat|null
- getCommonChatId() : int|null
- getContext() : Context
- Returns the local or global context for the action.
- getDataClass() : string|DataManager
- Returns ORM tablet class name.
- getDataEntityCollection() : Collection
- Before external call, call prepare method to update the state of the entity @see BaseLinkCollection::prepareFields()
- getFileIds() : array<int, array<string|int, int>>
- getFiles() : FileCollection
- getIds() : array<string|int, int>
- getPopupData() : PopupData
- Returns the data to be raised to the top of the REST response. Works on the principle of the composite pattern.
- getPrimaryIds() : array<string|int, int>
- getReactions() : ReactionMessages
- getRelatedChatId() : int|null
- getReminders() : ReminderCollection
- getReplayedMessageIds() : array<string|int, mixed>
- getRestEntityName() : string
- Returns the name of the entity that will be used in the rest response
- getUserIds() : array<string|int, mixed>
- hasUnsaved() : bool
- load() : Result
- Restores object state from database.
- merge() : static
- offsetGet() : Message
- offsetSet() : void
- Alias to add method.
- save() : Result
- Saves collection objects states into database.
- setContext() : self
- Sets new context for operations.
- setContextUser() : self
- setViewedByOthers() : self
- toRestFormat() : array<string|int, mixed>|null
- Returns an array in JSON like format to return the entity as a rest response.
- unsetByKeys() : void
- withContext() : static
- Provides local context for the action.
- withContextUser() : static
- Provides local context for the action.
Methods
__construct()
public
__construct([mixed $source = null ]) : mixed
Parameters
- $source : mixed = null
add()
Append collection with new item.
public
add(ActiveRecord $entry) : static
Parameters
- $entry : ActiveRecord
Tags
Return values
staticdelete()
Delete from the database all entities that are in the registry and have an id
public
delete() : Result
Return values
ResultfillAllForRest()
public
fillAllForRest([bool $shortInfo = false ][, bool $onlyCommonInfo = false ]) : self
Parameters
- $shortInfo : bool = false
- $onlyCommonInfo : bool = false
Return values
selffillFiles()
public
fillFiles() : self
Return values
selffillParams()
public
fillParams() : self
Return values
selffillReactions()
public
fillReactions() : self
Return values
selffillUnread()
public
fillUnread() : self
Return values
selffillUrls()
public
fillUrls() : self
Return values
selffillUuid()
public
fillUuid() : self
Return values
selffillViewed()
public
fillViewed() : self
Return values
selffilter()
public
filter(callable $predicate) : self
Parameters
- $predicate : callable
Return values
selffilterByChatId()
public
filterByChatId(int $chatId) : self
Parameters
- $chatId : int
Return values
selffilterByDate()
public
filterByDate(DateTime $date) : FilterResult<string|int, static>
Parameters
- $date : DateTime
Return values
FilterResult<string|int, static>find()
public
static find(array<string|int, mixed> $filter, array<string|int, mixed> $order[, int|null $limit = null ][, Context|null $context = null ][, array<string|int, mixed> $select = [] ]) : static
Parameters
- $filter : array<string|int, mixed>
- $order : array<string|int, mixed>
- $limit : int|null = null
- $context : Context|null = null
- $select : array<string|int, mixed> = []
Tags
Return values
staticgetAny()
public
getAny() : T|null
Return values
T|nullgetCollectionElementClass()
Returns collection item's class name.
public
static getCollectionElementClass() : string
Tags
Return values
stringgetCommonChat()
public
getCommonChat() : Chat|null
Return values
Chat|nullgetCommonChatId()
public
getCommonChatId() : int|null
Return values
int|nullgetContext()
Returns the local or global context for the action.
public
getContext() : Context
Return values
ContextgetDataClass()
Returns ORM tablet class name.
public
final static getDataClass() : string|DataManager
Return values
string|DataManagergetDataEntityCollection()
Before external call, call prepare method to update the state of the entity @see BaseLinkCollection::prepareFields()
public
getDataEntityCollection() : Collection
Return values
CollectiongetFileIds()
public
getFileIds() : array<int, array<string|int, int>>
Return values
array<int, array<string|int, int>>getFiles()
public
getFiles() : FileCollection
Return values
FileCollectiongetIds()
public
getIds() : array<string|int, int>
Return values
array<string|int, int>getPopupData()
Returns the data to be raised to the top of the REST response. Works on the principle of the composite pattern.
public
getPopupData([array<string|int, mixed> $excludedList = [] ]) : PopupData
Parameters
- $excludedList : array<string|int, mixed> = []
Return values
PopupDatagetPrimaryIds()
public
getPrimaryIds() : array<string|int, int>
Return values
array<string|int, int>getReactions()
public
getReactions() : ReactionMessages
Return values
ReactionMessagesgetRelatedChatId()
public
getRelatedChatId() : int|null
Return values
int|nullgetReminders()
public
getReminders() : ReminderCollection
Return values
ReminderCollectiongetReplayedMessageIds()
public
getReplayedMessageIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getRestEntityName()
Returns the name of the entity that will be used in the rest response
public
static getRestEntityName() : string
Return values
stringgetUserIds()
public
getUserIds() : array<string|int, mixed>
Return values
array<string|int, mixed>hasUnsaved()
public
hasUnsaved() : bool
Return values
boolload()
Restores object state from database.
public
load(array<string|int, int>|array<string|int, mixed>|Collection $source) : Result
Parameters
- $source : array<string|int, int>|array<string|int, mixed>|Collection
Return values
Resultmerge()
public
merge(Registry<string|int, T> $registry) : static
Parameters
- $registry : Registry<string|int, T>
Return values
staticoffsetGet()
public
offsetGet(mixed $key) : Message
Parameters
- $key : mixed
Return values
MessageoffsetSet()
Alias to add method.
public
offsetSet(mixed $offset, mixed $entry) : void
Parameters
- $offset : mixed
- $entry : mixed
save()
Saves collection objects states into database.
public
save([bool $isGroupSave = false ]) : Result
Parameters
- $isGroupSave : bool = false
Return values
ResultsetContext()
Sets new context for operations.
public
setContext(Context|null $context) : self
Parameters
- $context : Context|null
Return values
selfsetContextUser()
public
setContextUser(mixed $user) : self
Parameters
- $user : mixed
Return values
selfsetViewedByOthers()
public
setViewedByOthers() : self
Return values
selftoRestFormat()
Returns an array in JSON like format to return the entity as a rest response.
public
toRestFormat([array<string|int, mixed> $option = [] ]) : array<string|int, mixed>|null
Parameters
- $option : array<string|int, mixed> = []
Return values
array<string|int, mixed>|nullunsetByKeys()
public
unsetByKeys(array<string|int, mixed> $keys) : void
Parameters
- $keys : array<string|int, mixed>
withContext()
Provides local context for the action.
public
withContext(Context|null $context) : static
Parameters
- $context : Context|null
Return values
staticwithContextUser()
Provides local context for the action.
public
withContextUser(int|User|User $user) : static
Parameters
- $user : int|User|User