MDL-55611 calendar: fix calendar_event uses
authorDamyon Wiese <damyon@moodle.com>
Fri, 24 Mar 2017 06:09:53 +0000 (14:09 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 4 Apr 2017 10:01:44 +0000 (11:01 +0100)
It was renamed to \core_calendar::event

calendar/tests/rrule_manager_test.php
mod/quiz/lib.php

index 2b0f315..11b1662 100644 (file)
@@ -40,7 +40,7 @@ use core_calendar\rrule_manager;
  */
 class core_calendar_rrule_manager_testcase extends advanced_testcase {
 
-    /** @var calendar_event a dummy event */
+    /** @var core_calendar\event a dummy event */
     protected $event;
 
     /**
@@ -78,7 +78,7 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
         $event->groupid = 0;
         $event->courseid = 0;
         $event->eventtype = 'user';
-        $eventobj = calendar_event::create($event, false);
+        $eventobj = core_calendar\event::create($event, false);
         $DB->set_field('event', 'repeatid', $eventobj->id, array('id' => $eventobj->id));
         $eventobj->repeatid = $eventobj->id;
         $this->event = $eventobj;
@@ -2703,7 +2703,7 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
         $newdatetime = DateTime::createFromFormat('Ymd\THis', $datestr, $timezone);
 
         // Update the start date of the parent event.
-        $calevent = calendar_event::load($this->event->id);
+        $calevent = core_calendar\event::load($this->event->id);
         $updatedata = (object)[
             'timestart' => $newdatetime->getTimestamp(),
             'repeatid' => $this->event->id
index a704937..99a7dad 100644 (file)
@@ -197,7 +197,7 @@ function quiz_delete_instance($id) {
 
     $events = $DB->get_records('event', array('modulename' => 'quiz', 'instance' => $quiz->id));
     foreach ($events as $event) {
-        $event = calendar_event::load($event);
+        $event = core_calendar\event::load($event);
         $event->delete();
     }
 
@@ -2129,4 +2129,4 @@ function mod_quiz_core_calendar_provide_event_action(\core_calendar\event $event
         $itemcount,
         $actionable
     );
-}
\ No newline at end of file
+}