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/>.
18 * mod_assign submission updated event.
21 * @copyright 2013 Frédéric Massart
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 namespace mod_assign\event;
27 defined('MOODLE_INTERNAL') || die();
30 * mod_assign submission updated event class.
33 * @copyright 2013 Frédéric Massart
34 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36 class submission_updated extends \core\event\base {
43 protected $legacylogdata;
46 * Returns description of what happened.
50 public function get_description() {
51 return "The user {$this->userid} has updated the submission {$this->objectid}.";
55 * Return legacy data for add_to_log().
59 protected function get_legacy_logdata() {
60 return $this->legacylogdata;
64 * Return localised event name.
68 public static function get_name() {
69 return get_string('event_submission_updated', 'mod_assign');
73 * Get URL related to the action.
77 public function get_url() {
78 return new \moodle_url('/mod/assign/view.php', array('id' => $this->contextinstanceid));
86 protected function init() {
87 $this->data['crud'] = 'u';
88 $this->data['edulevel'] = self::LEVEL_PARTICIPATING;
89 $this->data['objecttable'] = 'assign_submission';
93 * Sets the legacy event log data.
95 * @param stdClass $legacylogdata legacy log data.
98 public function set_legacy_logdata($legacylogdata) {
99 $this->legacylogdata = $legacylogdata;