FileCollection extends BaseLinkCollection uses SidebarFilterProcessorTrait, MigrationStatusCheckerTrait
Tags
Table of Contents
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
- fillFiles() : FileCollection
- filter() : $this
- filterByDate() : FilterResult<string|int, static|null>
- find() : static
- getAny() : T|null
- getByDiskFileId() : self
- getCollectionElementClass() : string|LinkItem
- Returns collection item's class name.
- 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()
- getEntityIds() : array<string|int, mixed>
- 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>
- getRelatedChatId() : int|null
- getRestEntityName() : string
- Returns the name of the entity that will be used in the rest response
- hasUnsaved() : bool
- linkEntityToMessage() : static
- load() : Result
- Restores object state from database.
- merge() : static
- offsetGet() : FileItem
- offsetSet() : void
- Alias to add method.
- save() : Result
- Saves collection objects states into database.
- setMessageInfo() : static
- Associates the entity with the passed message by filling in the messageId, chatId and authorId
- toRestFormat() : array<string|int, mixed>|null
- Returns an array in JSON like format to return the entity as a rest response.
- toRestFormatIdOnly() : array<string|int, mixed>
- Returns an array containing the id of the link and the id of the linked entity, or an array of such arrays
- unsetByKeys() : void
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
ResultfillFiles()
public
fillFiles() : FileCollection
Return values
FileCollectionfilter()
public
filter(callable $predicate) : $this
Parameters
- $predicate : callable
Return values
$thisfilterByDate()
public
filterByDate(DateTime $date) : FilterResult<string|int, static|null>
Parameters
- $date : DateTime
Return values
FilterResult<string|int, static|null>find()
public
static find([array<string|int, mixed> $filter = [] ][, array<string|int, mixed> $order = ['ID' => 'DESC'] ][, int|null $limit = null ][, Context|null $context = null ]) : static
Parameters
- $filter : array<string|int, mixed> = []
- $order : array<string|int, mixed> = ['ID' => 'DESC']
- $limit : int|null = null
- $context : Context|null = null
Return values
staticgetAny()
public
getAny() : T|null
Return values
T|nullgetByDiskFileId()
public
static getByDiskFileId(int $diskFileId) : self
Parameters
- $diskFileId : int
Return values
selfgetCollectionElementClass()
Returns collection item's class name.
public
static getCollectionElementClass() : string|LinkItem
Return values
string|LinkItemgetDataClass()
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
CollectiongetEntityIds()
public
getEntityIds() : array<string|int, mixed>
Return values
array<string|int, mixed>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>getRelatedChatId()
public
getRelatedChatId() : int|null
Return values
int|nullgetRestEntityName()
Returns the name of the entity that will be used in the rest response
public
static getRestEntityName() : string
Return values
stringhasUnsaved()
public
hasUnsaved() : bool
Return values
boollinkEntityToMessage()
public
static linkEntityToMessage(EntityCollection $entities, Message $message) : static
Parameters
- $entities : EntityCollection
- $message : Message
Tags
Return values
staticload()
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) : FileItem
Parameters
- $key : mixed
Return values
FileItemoffsetSet()
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
ResultsetMessageInfo()
Associates the entity with the passed message by filling in the messageId, chatId and authorId
public
setMessageInfo(Message $message) : static
Parameters
- $message : Message
Return values
statictoRestFormat()
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>|nulltoRestFormatIdOnly()
Returns an array containing the id of the link and the id of the linked entity, or an array of such arrays
public
toRestFormatIdOnly() : array<string|int, mixed>
Return values
array<string|int, mixed>unsetByKeys()
public
unsetByKeys(array<string|int, mixed> $keys) : void
Parameters
- $keys : array<string|int, mixed>