Documentation

RecentCollection class

Class represents collection of "Recent" tab items. Each collection item is represented by class RecentItem.

Objects of collection are created automatically and available in data provider via the methods $dialog->getRecentItems() and $dialog->getGlobalRecentItems() Dialog class.

Use the following methods for adding items to "Recent" tab $dialog->addRecentItem() or $dialog->addRecentItems() Dialog class.

Method Description Available from version
add(RecentItem $recentItem): bool Adds an item (object of class RecentItem) to collection.
Use the following methods for adding items in data provider $dialog->addRecentItem() or $dialog->addRecentItems().
get(string $entityId, $itemId): ?RecentItem Returns a collection item by specified entity entity and item IDs.
has(RecentItem $recentItem): bool Returns true when specified item is available in collection.
getByItem(Item $item): ?RecentItem Returns collection item by specified dialog item (object of class Item).
getAll(): array Returns array with all items.
count(): int Returns number of collection items.
getEntityItems(string $entityId): array Returns array with specified entity items.

© «Bitrix24», 2001-2024
Up