2
// This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
19
defined('MOODLE_INTERNAL') || die();
22
* Course updated event.
26
* @copyright 2013 Mark Nelson <markn@moodle.com>
27
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29
class course_updated extends base {
31
/** @var array The legacy log data. */
32
private $legacylogdata;
35
* Initialise the event data.
37
protected function init() {
38
$this->data['objecttable'] = 'course';
39
$this->data['crud'] = 'u';
40
$this->data['level'] = self::LEVEL_TEACHING;
44
* Returns localised general event name.
48
public static function get_name() {
49
return get_string('eventcourseupdated');
53
* Returns non-localised description of what happened.
57
public function get_description() {
58
return "Course {$this->courseid} was updated by user {$this->userid}";
62
* Returns relevant URL.
66
public function get_url() {
67
return new \moodle_url('/course/view.php', array('id' => $this->objectid));
71
* Returns the name of the legacy event.
73
* @return string legacy event name
75
public static function get_legacy_eventname() {
76
return 'course_updated';
80
* Returns the legacy event data.
82
* @return \stdClass the course that was updated
84
protected function get_legacy_eventdata() {
85
return $this->get_record_snapshot('course', $this->objectid);
89
* Set the legacy data used for add_to_log().
91
* @param array $logdata
93
public function set_legacy_logdata($logdata) {
94
$this->legacylogdata = $logdata;
98
* Return legacy data for add_to_log().
102
protected function get_legacy_logdata() {
103
return $this->legacylogdata;