Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

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: 337 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


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.

content_item_from_legacy_data(\stdClass $item)   X-Ref
Create a content_item object based on legacy data returned from the get_shortcuts hook implementations.

param: \stdClass $item the stdClass of legacy data.
return: content_item a content item object.

content_item_to_legacy_data(content_item $contentitem)   X-Ref
Create a stdClass type object based on a content_item instance.

param: content_item $contentitem
return: \stdClass the legacy data.

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

legacy_item_inherit_missing(\stdClass $legacyitem, content_item $modulecontentitem)   X-Ref
Helper to make sure any legacy items have certain properties, which, if missing are inherited from the parent module item.

param: \stdClass $legacyitem the legacy information, a stdClass coming from get_shortcuts() hook.
param: content_item $modulecontentitem The module's content item information, to inherit if needed.
return: \stdClass the updated legacy item stdClass

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