Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 402] [Versions 400 and 403]

This file defines the core_privacy\local\metadata\collection class object. The collection class is used to organize a collection of types objects, which contains the privacy field details of a component.

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

Defines 1 class


Class: collection  - X-Ref

A collection of metadata items.

__construct($component)   X-Ref
Constructor for a component's privacy collection class.

param: string $component component name.

add_type(type $type)   X-Ref
Function to add an object that implements type interface to the current collection.

return: $this
param: type    $type to add to collection.

add_database_table($name, array $privacyfields, $summary = '')   X-Ref
Function to add a database table which contains user data to this collection.

return: $this
param: string  $name the name of the database table.
param: array   $privacyfields An associative array of fieldname to description.
param: string  $summary A description of what the table is used for.

add_subsystem_link($name, array $privacyfields = [], $summary = '')   X-Ref
Function to link a subsystem to the component.

return: $this
param: string $name the name of the subsystem to link.
param: array $privacyfields An optional associative array of fieldname to description.
param: string $summary A description of what is stored within this subsystem.

link_subsystem($name, $summary = '')   X-Ref
Old function to link a subsystem to the component.

This function is legacy and is not recommended. Please use add_subsystem_link() instead.

return: $this
param: string $name the name of the subsystem to link.
param: string $summary A description of what is stored within this subsystem.

add_plugintype_link($name, array $privacyfields = [], $summary = '')   X-Ref
Function to link a plugin to the component.

return: $this
param: string  $name the name of the plugin to link.
param: array $privacyfields An optional associative array of fieldname to description.
param: string  $summary A description of what is stored within this plugin.

link_plugintype($name, $summary = '')   X-Ref
Old function to link a plugin to the component.

This function is legacy and is not recommended. Please use add_plugintype_link() instead.

return: $this
param: string  $name the name of the plugin to link.
param: string  $summary A description of what is stored within this plugin.

add_external_location_link($name, array $privacyfields, $summary = '')   X-Ref
Function to indicate that data may be exported to an external location.

return: $this
param: string  $name A name for the type of data exported.
param: array   $privacyfields A list of fields with their description.
param: string  $summary A description of what the table is used for. This is a language string identifier

link_external_location($name, array $privacyfields, $summary = '')   X-Ref
Old function to indicate that data may be exported to an external location.

This function is legacy and is not recommended. Please use add_external_location_link() instead.

return: $this
param: string  $name A name for the type of data exported.
param: array   $privacyfields A list of fields with their description.
param: string  $summary A description of what the table is used for. This is a language string identifier

add_user_preference($name, $summary = '')   X-Ref
Add a type of user preference to the collection.

Typically this is a single user preference, but in some cases the
name of a user preference fits a particular format.

return: $this
param: string  $name The name of the user preference.
param: string  $summary A description of what the preference is used for.

get_component()   X-Ref
Function to return the current component name.

return: string

get_collection()   X-Ref
The content of this collection.

return: types\type[]