Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402]

Contains class content_item_repository, for fetching content_items.

Copyright: 2020 Jake Dallimore <jrhdallimore@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 243 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

content_item_readonly_repository:: (5 methods):
  get_core_module_help_string()
  get_subplugin_course_content_items()
  get_subplugin_all_content_items()
  find_all()
  find_all_for_course()


Class: content_item_readonly_repository  - X-Ref

The class content_item_repository, for reading content_items.

get_core_module_help_string(string $modname)   X-Ref
Get the help string for content items representing core modules.

param: string $modname the module name.
return: string the help string, including help link.

get_subplugin_course_content_items(string $parentpluginname, content_item $modulecontentitem,\stdClass $user)   X-Ref
Helper to get the contentitems from all subplugin hooks for a given module plugin.

param: string $parentpluginname the name of the module plugin to check subplugins for.
param: content_item $modulecontentitem the content item of the module plugin, to pass to the hooks.
param: \stdClass $user the user object to pass to subplugins.
return: array the array of content items.

get_subplugin_all_content_items(string $parentpluginname, content_item $modulecontentitem)   X-Ref
Get all the content items for a subplugin.

param: string $parentpluginname
param: content_item $modulecontentitem
return: array

find_all()   X-Ref
Find all the available content items, not restricted to course or user.

return: array the array of content items.

find_all_for_course(\stdClass $course, \stdClass $user)   X-Ref
Get the list of potential content items for the given course.

param: \stdClass $course the course
param: \stdClass $user the user, to pass to plugins implementing callbacks.
return: array the array of content_item objects