Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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   * Calendar event interface.
  19   *
  20   * @package    core_calendar
  21   * @copyright  2017 Cameron Ball <cameron@cameron1729.xyz>
  22   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  
  25  namespace core_calendar\local\event\entities;
  26  
  27  use core_calendar\local\event\proxies\proxy_interface;
  28  
  29  defined('MOODLE_INTERNAL') || die();
  30  
  31  /**
  32   * Interface for an event class.
  33   *
  34   * @copyright  2017 Cameron Ball <cameron@cameron1729.xyz>
  35   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  36   */
  37  interface event_interface {
  38      /**
  39       * Get the event's ID.
  40       *
  41       * @return integer
  42       */
  43      public function get_id();
  44  
  45      /**
  46       * Get the event's name.
  47       *
  48       * @return string
  49       */
  50      public function get_name();
  51  
  52      /**
  53       * Get the event's description.
  54       *
  55       * @return description_interface
  56       */
  57      public function get_description();
  58  
  59      /**
  60       * Get the event's location.
  61       *
  62       * @return location_interface
  63       */
  64      public function get_location();
  65  
  66      /**
  67       * Get the category object associated with the event.
  68       *
  69       * @return proxy_interface
  70       */
  71      public function get_category();
  72  
  73      /**
  74       * Get the course object associated with the event.
  75       *
  76       * @return proxy_interface
  77       */
  78      public function get_course();
  79  
  80      /**
  81       * Get the course module object that created the event.
  82       *
  83       * @return proxy_interface
  84       */
  85      public function get_course_module();
  86  
  87      /**
  88       * Get the group object associated with the event.
  89       *
  90       * @return proxy_interface
  91       */
  92      public function get_group();
  93  
  94      /**
  95       * Get the user object associated with the event.
  96       *
  97       * @return proxy_interface
  98       */
  99      public function get_user();
 100  
 101      /**
 102       * Get the event's type.
 103       *
 104       * @return string
 105       */
 106      public function get_type();
 107  
 108      /**
 109       * Get the times associated with the event.
 110       *
 111       * @return times_interface
 112       */
 113      public function get_times();
 114  
 115      /**
 116       * Get repeats of this event or null if the event has no
 117       * repeats.
 118       *
 119       * @return event_collection_interface|null
 120       */
 121      public function get_repeats();
 122  
 123      /**
 124       * Get the event's subscription.
 125       *
 126       * @return proxy_interface
 127       */
 128      public function get_subscription();
 129  
 130      /**
 131       * Get the event's visibility.
 132       *
 133       * @return bool true if the event is visible, false otherwise
 134       */
 135      public function is_visible();
 136  
 137      /**
 138       * Resolved event component (frankenstyle name of activity module or the component)
 139       * @return string|null
 140       */
 141      public function get_component();
 142  }