Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are 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  namespace core_payment\privacy;
  18  
  19  use core_privacy\local\request\approved_contextlist;
  20  use core_privacy\local\request\approved_userlist;
  21  use core_privacy\local\request\userlist;
  22  use context;
  23  
  24  interface consumer_provider {
  25  
  26      /**
  27       * Return contextid for the provided payment data
  28       *
  29       * @param string $paymentarea Payment area
  30       * @param int $itemid The item id
  31       * @return int|null
  32       */
  33      public static function get_contextid_for_payment(string $paymentarea, int $itemid): ?int;
  34  
  35      /**
  36       * Get the list of users who have data within a context.
  37       *
  38       * @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination.
  39       */
  40      public static function get_users_in_context(userlist $userlist);
  41  
  42      /**
  43       * Export all user data for the specified user, in the specified contexts.
  44       *
  45       * @param approved_contextlist $contextlist The approved contexts to export information for.
  46       */
  47      public static function export_user_data(approved_contextlist $contextlist);
  48  
  49      /**
  50       * Delete all data for all users in the specified context.
  51       *
  52       * @param context $context The specific context to delete data for.
  53       */
  54      public static function delete_data_for_all_users_in_context(context $context);
  55  
  56      /**
  57       * Delete all user data for the specified user, in the specified contexts.
  58       *
  59       * @param approved_contextlist $contextlist The approved contexts and user information to delete information for.
  60       */
  61      public static function delete_data_for_user(approved_contextlist $contextlist);
  62  
  63      /**
  64       * Delete multiple users within a single context.
  65       *
  66       * @param approved_userlist $userlist The approved context and user information to delete information for.
  67       */
  68      public static function delete_data_for_users(approved_userlist $userlist);
  69  }