mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-44017 Events: Deprecated content_viewed event
Replaced content_viewed event with appropriate events and deprecated content_viewed event
This commit is contained in:
parent
0a489777fc
commit
e1b16f9773
39 changed files with 1291 additions and 453 deletions
|
@ -28,18 +28,15 @@ defined('MOODLE_INTERNAL') || die();
|
|||
/**
|
||||
* mod_chat sessions viewed event class.
|
||||
*
|
||||
* @property-read array $other {
|
||||
* Extra information about event.
|
||||
*
|
||||
* @type int start start of period.
|
||||
* @type int end end of period.
|
||||
* }
|
||||
* @property-read array $other Extra information about the event.
|
||||
* -int start: start of period.
|
||||
* -int end: end of period.
|
||||
*
|
||||
* @package mod_chat
|
||||
* @copyright 2013 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class sessions_viewed extends \core\event\content_viewed {
|
||||
class sessions_viewed extends \core\event\base {
|
||||
|
||||
/**
|
||||
* Returns description of what happened.
|
||||
|
@ -96,8 +93,12 @@ class sessions_viewed extends \core\event\content_viewed {
|
|||
* @return void
|
||||
*/
|
||||
protected function validate_data() {
|
||||
// The parent class requires this to be non-empty. We are setting it and ignore the parent validation.
|
||||
$this->data['other']['content'] = '';
|
||||
if (!isset($this->data['other']['start'])) {
|
||||
throw new \coding_exception('The property start must be set in other.');
|
||||
}
|
||||
if (!isset($this->data['other']['end'])) {
|
||||
throw new \coding_exception('The property end must be set in other.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue