MDL-62217 search_solr: Plugin provider fake implementation
[moodle.git] / search / engine / solr / classes / privacy / provider.php
CommitLineData
74fc7d31
DM
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.
13//
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/>.
16
17/**
18 * Privacy class for requesting user data.
19 *
20 * @package search_solr
21 * @copyright 2018 David Monllao
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 */
24namespace search_solr\privacy;
25
26defined('MOODLE_INTERNAL') || die();
27
28use core_privacy\local\metadata\collection;
94522f8d
DM
29use core_privacy\local\request\contextlist;
30use core_privacy\local\request\approved_contextlist;
74fc7d31
DM
31
32/**
33 * Provider for the search_solr plugin.
34 *
35 * @copyright 2018 David Monllao
36 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37 */
38class provider implements
39 // This search engine plugin does not store any data itself.
40 // It has no database tables, and it purely acts as a conduit, sending data externally.
94522f8d 41 \core_privacy\local\metadata\provider, \core_privacy\local\request\plugin\provider {
74fc7d31
DM
42
43 /**
44 * Returns meta data about this system.
45 *
46 * @param collection $collection The initialised collection to add items to.
47 * @return collection A listing of user data stored through this system.
48 */
49 public static function get_metadata(collection $collection) : collection {
50 return $collection->add_external_location_link('solr', ['data' => 'privacy:metadata:data'],
51 'privacy:metadata');
52 }
94522f8d
DM
53
54 /**
55 * Get the list of contexts that contain user information for the specified user.
56 *
57 * @param int $userid The user to search.
58 * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
59 */
60 public static function get_contexts_for_userid(int $userid) : contextlist {
61 return new contextlist();
62 }
63
64 /**
65 * Export all user data for the specified user, in the specified contexts.
66 *
67 * @param approved_contextlist $contextlist The approved contexts to export information for.
68 */
69 public static function export_user_data(approved_contextlist $contextlist) {
70 }
71
72 /**
73 * Delete all data for all users in the specified context.
74 *
75 * @param context $context The specific context to delete data for.
76 */
77 public static function delete_data_for_all_users_in_context(\context $context) {
78 }
79
80 /**
81 * Delete all user data for the specified user, in the specified contexts.
82 *
83 * @param approved_contextlist $contextlist The approved contexts and user information to delete information for.
84 */
85 public static function delete_data_for_user(approved_contextlist $contextlist) {
86 }
74fc7d31 87}