MDL-37624 calendar: Added location support
[moodle.git] / calendar / classes / local / event / entities / action_event.php
CommitLineData
e46efe3a
CB
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 action event class.
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
25namespace core_calendar\local\event\entities;
26
27defined('MOODLE_INTERNAL') || die();
28
42e76c3f 29use core_calendar\local\event\factories\action_factory_interface;
e46efe3a
CB
30
31/**
32 * Class representing an actionable event.
33 *
34 * An actionable event can be thought of as an embellished event. That is,
35 * it does everything a regular event does, but has some extra information
36 * attached to it. For example, the URL a user needs to visit to complete
37 * an action, the number of actionable items, etc.
38 *
39 * @copyright 2017 Cameron Ball <cameron@cameron1729.xyz>
40 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41 */
42class action_event implements action_event_interface {
43 /**
44 * @var event_interface $event The event to delegate to.
45 */
46 protected $event;
47
48 /**
49 * @var action_interface $action The action associated with this event.
50 */
51 protected $action;
52
0085b0ea
AN
53 /**
54 * @var proxy_interface $category Category for this event.
55 */
56 protected $category;
57
e46efe3a 58 /**
5ca71c2d 59 * Constructor.
e46efe3a
CB
60 *
61 * @param event_interface $event The event to delegate to.
62 * @param action_interface $action The action associated with this event.
63 */
64 public function __construct(event_interface $event, action_interface $action) {
65 $this->event = $event;
66 $this->action = $action;
67 }
68
69 public function get_id() {
70 return $this->event->get_id();
71 }
72
73 public function get_name() {
74 return $this->event->get_name();
75 }
76
77 public function get_description() {
78 return $this->event->get_description();
79 }
80
ef4e04ee
MH
81 public function get_location() {
82 return $this->event->get_location();
83 }
84
0085b0ea
AN
85 public function get_category() {
86 return $this->event->get_category();
87 }
88
e46efe3a
CB
89 public function get_course() {
90 return $this->event->get_course();
91 }
92
93 public function get_course_module() {
94 return $this->event->get_course_module();
95 }
96
97 public function get_group() {
98 return $this->event->get_group();
99 }
100
101 public function get_user() {
102 return $this->event->get_user();
103 }
104
105 public function get_type() {
106 return $this->event->get_type();
107 }
108
109 public function get_times() {
110 return $this->event->get_times();
111 }
112
113 public function get_repeats() {
114 return $this->event->get_repeats();
115 }
116
5ca71c2d
CB
117 public function get_subscription() {
118 return $this->event->get_subscription();
e46efe3a
CB
119 }
120
121 public function is_visible() {
122 return $this->event->is_visible();
123 }
124
125 public function get_action() {
126 return $this->action;
127 }
128}