Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.
   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   * This file contains the \core_privacy\local\request\core_user_data_provider interface to describe
  19   * classes which provide user data in some form to core.
  20   *
  21   * @package core_privacy
  22   * @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
  23   *
  24   * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  25   */
  26  namespace core_privacy\local\request;
  27  
  28  defined('MOODLE_INTERNAL') || die();
  29  
  30  /**
  31   * The core_user_data_provider interface is used to describe a provider
  32   * which services user requests between components and core.
  33   *
  34   * It describes data how these requests are serviced in a specific format.
  35   *
  36   * @package core_privacy
  37   * @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
  38   */
  39  interface core_user_data_provider extends core_data_provider {
  40  
  41      /**
  42       * Get the list of contexts that contain user information for the specified user.
  43       *
  44       * @param   int         $userid     The user to search.
  45       * @return  contextlist   $contextlist  The contextlist containing the list of contexts used in this plugin.
  46       */
  47      public static function get_contexts_for_userid(int $userid) : contextlist;
  48  
  49      /**
  50       * Export all user data for the specified user, in the specified contexts.
  51       *
  52       * @param   approved_contextlist    $contextlist    The approved contexts to export information for.
  53       */
  54      public static function export_user_data(approved_contextlist $contextlist);
  55  
  56      /**
  57       * Delete all data for all users in the specified context.
  58       *
  59       * @param   context                 $context   The specific context to delete data for.
  60       */
  61      public static function delete_data_for_all_users_in_context(\context $context);
  62  
  63      /**
  64       * Delete all user data for the specified user, in the specified contexts.
  65       *
  66       * @param   approved_contextlist    $contextlist    The approved contexts and user information to delete information for.
  67       */
  68      public static function delete_data_for_user(approved_contextlist $contextlist);
  69  }