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] [Versions 401 and 402]

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.

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

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

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.
return: $this

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

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.
return: $this

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.

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

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

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.
return: $this

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.

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

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

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
return: $this

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.

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
return: $this

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.

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

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

return: string

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

return: type[]