weekly back-to-dev release 5.0dev
[moodle.git] / communication / classes / privacy / provider.php
blob9c7f4d1659a4a8ebe555c4cf15390f26cbf49b68
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17 namespace core_communication\privacy;
19 use core_privacy\local\metadata\collection;
20 use core_privacy\local\request\approved_contextlist;
21 use core_privacy\local\request\approved_userlist;
22 use core_privacy\local\request\contextlist;
23 use core_privacy\local\request\userlist;
25 /**
26 * Privacy Subsystem for core_communication implementing null_provider.
28 * @package core_communication
29 * @copyright 2023 Huong Nguyen <huongnv13@gmail.com>
30 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32 class provider implements
33 \core_privacy\local\request\core_userlist_provider,
34 \core_privacy\local\metadata\provider,
35 \core_privacy\local\request\subsystem\provider {
36 public static function get_metadata(collection $collection): collection {
38 $collection->add_database_table('communication_user', [
39 'commid' => 'privacy:metadata:communication_user:commid',
40 'userid' => 'privacy:metadata:communication_user:userid',
41 'synced' => 'privacy:metadata:communication_user:synced',
42 ], 'privacy:metadata:communication_user');
44 return $collection;
47 public static function get_contexts_for_userid(int $userid): contextlist {
48 return new contextlist();
51 public static function export_user_data(approved_contextlist $contextlist) {
52 // None of the core communication tables should be exported.
55 public static function delete_data_for_all_users_in_context(\context $context) {
56 // None of the data from these tables should be deleted.
59 public static function delete_data_for_user(approved_contextlist $contextlist) {
60 // None of the data from these tables should be deleted.
63 public static function get_users_in_context(userlist $userlist) {
64 // Don't add any users.
67 public static function delete_data_for_users(approved_userlist $userlist) {
68 // None of the data from these tables should be deleted.