Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.
   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_flickr
  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_flickr\privacy;
  25  
  26  defined('MOODLE_INTERNAL') || die();
  27  
  28  use core_privacy\local\metadata\collection;
  29  
  30  /**
  31   * Provider for the portfolio_flickr 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('flickr.com', ['data' => 'privacy:metadata:data'], 'privacy:metadata');
  50      }
  51  
  52      /**
  53       * Export all portfolio data from each portfolio plugin for the specified userid and context.
  54       *
  55       * @param   int $userid The user to export.
  56       * @param   \context $context The context to export.
  57       * @param   array $subcontext The subcontext within the context to export this information to.
  58       * @param   array $linkarray The weird and wonderful link array used to display information for a specific item
  59       */
  60      public static function export_portfolio_user_data(int $userid, \context $context, array $subcontext, array $linkarray) {
  61      }
  62  
  63      /**
  64       * Delete all user information for the provided context.
  65       *
  66       * @param  \context $context The context to delete user data for.
  67       */
  68      public static function delete_portfolio_for_context(\context $context) {
  69      }
  70  
  71      /**
  72       * Delete all user information for the provided user and context.
  73       *
  74       * @param  int $userid The user to delete
  75       * @param  \context $context The context to refine the deletion.
  76       */
  77      public static function delete_portfolio_for_user(int $userid, \context $context) {
  78      }
  79  }