MDL-59750 core_calendar: better handling of event subscription
[moodle.git] / calendar / classes / external / event_exporter.php
index 917f07e..35ce4f9 100644 (file)
@@ -51,13 +51,6 @@ class event_exporter extends event_exporter_base {
 
         $values = parent::define_other_properties();
 
-        $values['displayeventsource'] = ['type' => PARAM_BOOL];
-        $values['subscription'] = [
-            'type' => PARAM_RAW,
-            'optional' => true,
-            'default' => null,
-            'null' => NULL_ALLOWED
-        ];
         $values['isactionevent'] = ['type' => PARAM_BOOL];
         $values['iscourseevent'] = ['type' => PARAM_BOOL];
         $values['candelete'] = ['type' => PARAM_BOOL];
@@ -130,22 +123,6 @@ class event_exporter extends event_exporter_base {
             $values['course'] = $coursesummaryexporter->export($output);
         }
 
-        // Handle event subscription.
-        $values['subscription'] = null;
-        $values['displayeventsource'] = false;
-        if ($event->get_subscription()) {
-            $subscription = calendar_get_subscription($event->get_subscription()->get('id'));
-            if (!empty($subscription) && $CFG->calendar_showicalsource) {
-                $values['displayeventsource'] = true;
-                $subscriptiondata = new \stdClass();
-                if (!empty($subscription->url)) {
-                    $subscriptiondata->url = $subscription->url;
-                }
-                $subscriptiondata->name = $subscription->name;
-                $values['subscription'] = json_encode($subscriptiondata);
-            }
-        }
-
         if ($group = $event->get_group()) {
             $values['groupname'] = format_string($group->get('name'), true,
                 ['context' => \context_course::instance($event->get_course()->get('id'))]);