|
ILIAS
trunk Revision v12.0_alpha-413-g215742c0453
|
Optimized News Collection with memory-efficient data structures to support large news feeds. More...
Inheritance diagram for ILIAS\News\Data\NewsCollection:
Collaboration diagram for ILIAS\News\Data\NewsCollection:Public Member Functions | |
| __construct (array $news_items=[]) | |
| addNewsItems (array $news_items) | |
| Add multiple news items efficiently. More... | |
| addNewsItem (NewsItem $item) | |
| Add a single news item with indexing. More... | |
| getNewsItems () | |
| getNewsForContext (int $context_obj_id, string $context_obj_type) | |
| getNewsByType (string $obj_type) | |
| setUserReadStatus (int $user_id, array $read_news_ids) | |
| isReadByUser (int $user_id, int $news_id) | |
| getUserReadStatus (int $user_id) | |
| groupFiles () | |
| groupForums (bool $group_posting_sequence) | |
| getGroupingFor (NewsItem $item) | |
| Returns the grouping for a given news item. More... | |
| getAggregatedNews (bool $aggregate_files=false, bool $aggregate_forums=false, bool $group_posting_sequence=false) | |
| Get news items in a format compatible with the legacy rendering implementation. More... | |
| jsonSerialize () | |
| getIterator () | |
| count () | |
| isEmpty () | |
| first () | |
| last () | |
| contains (int $news_id) | |
| getById (int $news_id) | |
| getPageFor (int $news_id) | |
| pick (int $offset) | |
| pluck (string $key, bool $wrap=false) | |
| toArray () | |
| merge (NewsCollection $other) | |
| Merge with another collection and returns it as a new collection. More... | |
| limit (?int $limit) | |
| Limit the number of news items and returns it as a new collection. More... | |
| exclude (array $news_ids) | |
| Returns a new collection with only the news items that are not in the provided list. More... | |
| load (array $news_ids=[]) | |
Protected Attributes | |
| array | $news_items = [] |
| array | $context_map = [] |
| array | $type_map = [] |
| array | $user_read_status = [] |
| array | $grouped_items_map = [] |
Optimized News Collection with memory-efficient data structures to support large news feeds.
It's designed for context-based filtering and fast_lookups.
Definition at line 29 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::__construct | ( | array | $news_items = [] | ) |
Definition at line 45 of file NewsCollection.php.
References ILIAS\News\Data\NewsCollection\addNewsItems().
Here is the call graph for this function:| ILIAS\News\Data\NewsCollection::addNewsItem | ( | NewsItem | $item | ) |
Add a single news item with indexing.
Definition at line 64 of file NewsCollection.php.
References $id, ILIAS\News\Data\NewsItem\getContextObjId(), ILIAS\News\Data\NewsItem\getContextObjType(), and ILIAS\News\Data\NewsItem\getId().
Referenced by ILIAS\News\Data\LazyNewsCollection\addNewsItems(), and ILIAS\News\Data\NewsCollection\addNewsItems().
Here is the call graph for this function:
Here is the caller graph for this function:| ILIAS\News\Data\NewsCollection::addNewsItems | ( | array | $news_items | ) |
Add multiple news items efficiently.
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 53 of file NewsCollection.php.
References ILIAS\News\Data\NewsCollection\$news_items, and ILIAS\News\Data\NewsCollection\addNewsItem().
Referenced by ILIAS\News\Data\NewsCollection\__construct().
Here is the call graph for this function:
Here is the caller graph for this function:| ILIAS\News\Data\NewsCollection::contains | ( | int | $news_id | ) |
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 344 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::count | ( | ) |
Definition at line 324 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::exclude | ( | array | $news_ids | ) |
Returns a new collection with only the news items that are not in the provided list.
| int[] | $news_ids |
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 421 of file NewsCollection.php.
Referenced by ILIAS\News\Domain\NewsCollectionService\applyFinalProcessing().
Here is the caller graph for this function:| ILIAS\News\Data\NewsCollection::first | ( | ) |
Definition at line 334 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::getAggregatedNews | ( | bool | $aggregate_files = false, |
| bool | $aggregate_forums = false, |
||
| bool | $group_posting_sequence = false |
||
| ) |
Get news items in a format compatible with the legacy rendering implementation.
This should never be introduced in new code and will be removed in the future.
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 224 of file NewsCollection.php.
References ILIAS\Repository\int(), and ILIAS\News\Data\NewsCollection\isReadByUser().
Here is the call graph for this function:| ILIAS\News\Data\NewsCollection::getById | ( | int | $news_id | ) |
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 349 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::getGroupingFor | ( | NewsItem | $item | ) |
Returns the grouping for a given news item.
It will return an array with the grouped items if the provided item is the first in the group.
Definition at line 189 of file NewsCollection.php.
References $id, ILIAS\News\Data\NewsItem\getContextObjId(), ILIAS\News\Data\NewsItem\getContextObjType(), ILIAS\News\Data\NewsItem\getContextRefId(), ILIAS\News\Data\NewsItem\getId(), and ILIAS\News\Data\NewsItem\withContent().
Here is the call graph for this function:| ILIAS\News\Data\NewsCollection::getIterator | ( | ) |
Definition at line 319 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::getNewsByType | ( | string | $obj_type | ) |
Definition at line 98 of file NewsCollection.php.
References $id.
| ILIAS\News\Data\NewsCollection::getNewsForContext | ( | int | $context_obj_id, |
| string | $context_obj_type | ||
| ) |
Definition at line 84 of file NewsCollection.php.
References $id.
Referenced by ilNewsForContextBlockGUI\loadNewsData().
Here is the caller graph for this function:| ILIAS\News\Data\NewsCollection::getNewsItems | ( | ) |
Definition at line 79 of file NewsCollection.php.
References ILIAS\News\Data\NewsCollection\$news_items.
Referenced by ILIAS\News\Data\NewsCollection\merge().
Here is the caller graph for this function:| ILIAS\News\Data\NewsCollection::getPageFor | ( | int | $news_id | ) |
Definition at line 354 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::getUserReadStatus | ( | int | $user_id | ) |
Definition at line 127 of file NewsCollection.php.
References ILIAS\News\Data\NewsCollection\isReadByUser().
Referenced by ILIAS\News\Persistence\NewsCache\storeNewsForUser().
Here is the call graph for this function:
Here is the caller graph for this function:| ILIAS\News\Data\NewsCollection::groupFiles | ( | ) |
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 140 of file NewsCollection.php.
Referenced by ilNewsForContextBlockGUI\loadNewsData().
Here is the caller graph for this function:| ILIAS\News\Data\NewsCollection::groupForums | ( | bool | $group_posting_sequence | ) |
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 157 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::isEmpty | ( | ) |
Definition at line 329 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::isReadByUser | ( | int | $user_id, |
| int | $news_id | ||
| ) |
Definition at line 119 of file NewsCollection.php.
References $user_id.
Referenced by ILIAS\News\Data\NewsCollection\getAggregatedNews(), and ILIAS\News\Data\NewsCollection\getUserReadStatus().
Here is the caller graph for this function:| ILIAS\News\Data\NewsCollection::jsonSerialize | ( | ) |
Definition at line 314 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::last | ( | ) |
Definition at line 339 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::limit | ( | ?int | $limit | ) |
Limit the number of news items and returns it as a new collection.
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 403 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::load | ( | array | $news_ids = [] | ) |
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 435 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::merge | ( | NewsCollection | $other | ) |
Merge with another collection and returns it as a new collection.
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 384 of file NewsCollection.php.
References $user_id, and ILIAS\News\Data\NewsCollection\getNewsItems().
Here is the call graph for this function:| ILIAS\News\Data\NewsCollection::pick | ( | int | $offset | ) |
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 360 of file NewsCollection.php.
| ILIAS\News\Data\NewsCollection::pluck | ( | string | $key, |
| bool | $wrap = false |
||
| ) |
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 366 of file NewsCollection.php.
Referenced by ilNewsForContextBlockGUI\initData().
Here is the caller graph for this function:| ILIAS\News\Data\NewsCollection::setUserReadStatus | ( | int | $user_id, |
| array | $read_news_ids | ||
| ) |
| array<int,bool> | $read_news_ids |
Definition at line 113 of file NewsCollection.php.
References $user_id.
| ILIAS\News\Data\NewsCollection::toArray | ( | ) |
Reimplemented in ILIAS\News\Data\LazyNewsCollection.
Definition at line 375 of file NewsCollection.php.
|
protected |
Definition at line 35 of file NewsCollection.php.
|
protected |
Definition at line 43 of file NewsCollection.php.
|
protected |
Definition at line 32 of file NewsCollection.php.
Referenced by ILIAS\News\Data\LazyNewsCollection\addNewsItems(), ILIAS\News\Data\NewsCollection\addNewsItems(), and ILIAS\News\Data\NewsCollection\getNewsItems().
|
protected |
Definition at line 38 of file NewsCollection.php.
|
protected |
Definition at line 41 of file NewsCollection.php.