Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
The class caching_content_item_repository, for fetching content_items, with additional caching. More...
Public Member Functions | |
__construct (\cache $cachestore, content_item_readonly_repository $contentitemrepository) | |
The caching_content_item_readonly_repository constructor. | |
find_all () | |
Find all the content items made available by core and plugins. | |
find_all_for_course (\stdClass $course, stdClass $user) | |
Find all the content items for a given course and user. | |
The class caching_content_item_repository, for fetching content_items, with additional caching.
This class decorates the content_item_repository and uses the supplied cache to store content items for user and course combinations. The content items for subsequent calls are returned from the cache if present, else are retrieved from the wrapped content_item_repository.
core_course\local\repository\caching_content_item_readonly_repository::__construct | ( | \cache | $cachestore, |
content_item_readonly_repository | $contentitemrepository ) |
The caching_content_item_readonly_repository constructor.
cache | $cachestore | a cache to use. |
content_item_readonly_repository | $contentitemrepository | the repository to use as a fallback, after a cache miss. |
core_course\local\repository\caching_content_item_readonly_repository::find_all | ( | ) |
Find all the content items made available by core and plugins.
array |
Implements core_course\local\repository\content_item_readonly_repository_interface.
core_course\local\repository\caching_content_item_readonly_repository::find_all_for_course | ( | \stdClass | $course, |
stdClass | $user ) |
Find all the content items for a given course and user.
stdClass | $course | The course to find content items for. |
stdClass | $user | the user to pass to plugins. |
array | the array of content items. |
Implements core_course\local\repository\content_item_readonly_repository_interface.