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   * Privacy class for requesting user data.
  19   *
  20   * @package    portfolio_googledocs
  21   * @copyright  2018 Jake Dallimore <jrhdallimore@gmail.com>
  22   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  namespace portfolio_googledocs\privacy;
  25  
  26  defined('MOODLE_INTERNAL') || die();
  27  
  28  use core_privacy\local\metadata\collection;
  29  
  30  /**
  31   * Provider for the portfolio_googledocs plugin.
  32   *
  33   * @copyright  2018 Jake Dallimore <jrhdallimore@gmail.com>
  34   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  35   */
  36  class provider implements
  37          // This portfolio plugin does not store any data itself.
  38          // It has no database tables, and it purely acts as a conduit, sending data externally.
  39          \core_privacy\local\metadata\provider,
  40          \core_portfolio\privacy\portfolio_provider {
  41  
  42      /**
  43       * Returns meta data about this system.
  44       *
  45       * @param   collection $collection The initialised collection to add items to.
  46       * @return  collection     A listing of user data stored through this system.
  47       */
  48      public static function get_metadata(collection $collection) : collection {
  49          return $collection->add_external_location_link('docs.google.com', ['data' => 'privacy:metadata:data'],
  50                                                         'privacy:metadata');
  51      }
  52  
  53      /**
  54       * Export all portfolio data from each portfolio plugin for the specified userid and context.
  55       *
  56       * @param   int $userid The user to export.
  57       * @param   \context $context The context to export.
  58       * @param   array $subcontext The subcontext within the context to export this information to.
  59       * @param   array $linkarray The weird and wonderful link array used to display information for a specific item
  60       */
  61      public static function export_portfolio_user_data(int $userid, \context $context, array $subcontext, array $linkarray) {
  62      }
  63  
  64      /**
  65       * Delete all user information for the provided context.
  66       *
  67       * @param  \context $context The context to delete user data for.
  68       */
  69      public static function delete_portfolio_for_context(\context $context) {
  70      }
  71  
  72      /**
  73       * Delete all user information for the provided user and context.
  74       *
  75       * @param  int $userid The user to delete
  76       * @param  \context $context The context to refine the deletion.
  77       */
  78      public static function delete_portfolio_for_user(int $userid, \context $context) {
  79      }
  80  }