original_string: protected static function export_monitor_rules(array $rules, \context_user $context) {
          foreach ($rules as $rule) {
              $rule = rule_manager::get_rule($rule);
              $ruledata = new \stdClass();
              $ruledata->name = $rule->name;
              $ruledata->eventname = $rule->get_event_name();
              $ruledata->description = $rule->get_description($context);
              $ruledata->plugin = $rule->get_plugin_name();
              $ruledata->template = $rule->template;
              $ruledata->frequency = $rule->get_filters_description();
              $ruledata->course = $rule->get_course_name($context);
              $ruledata->timecreated = transform::datetime($rule->timecreated);
              $ruledata->timemodified = transform::datetime($rule->timemodified);
              writer::with_context($context)->export_data([get_string('privacy:createdrules', 'tool_monitor'),
                      $rule->name . '_' . $rule->id], $ruledata);
          }
      }
code: protected static function export_monitor_rules(array $rules, \context_user $context) {
          foreach ($rules as $rule) {
              $rule = rule_manager::get_rule($rule);
              $ruledata = new \stdClass();
              $ruledata->name = $rule->name;
              $ruledata->eventname = $rule->get_event_name();
              $ruledata->description = $rule->get_description($context);
              $ruledata->plugin = $rule->get_plugin_name();
              $ruledata->template = $rule->template;
              $ruledata->frequency = $rule->get_filters_description();
              $ruledata->course = $rule->get_course_name($context);
              $ruledata->timecreated = transform::datetime($rule->timecreated);
              $ruledata->timemodified = transform::datetime($rule->timemodified);
              writer::with_context($context)->export_data([get_string('privacy:createdrules', 'tool_monitor'),
                      $rule->name . '_' . $rule->id], $ruledata);
          }
      }
code_tokens: protected static function export_monitor_rules ( array $ rules , \ context_user $ context ) { foreach ( $ rules as $ rule ) { $ rule = rule_manager :: get_rule ( $ rule ) ; $ ruledata = new \ stdClass ( ) ; $ ruledata -> name = $ rule -> name ; $ ruledata -> eventname = $ rule -> get_event_name ( ) ; $ ruledata -> description = $ rule -> get_description ( $ context ) ; $ ruledata -> plugin = $ rule -> get_plugin_name ( ) ; $ ruledata -> template = $ rule -> template ; $ ruledata -> frequency = $ rule -> get_filters_description ( ) ; $ ruledata -> course = $ rule -> get_course_name ( $ context ) ; $ ruledata -> timecreated = transform :: datetime ( $ rule -> timecreated ) ; $ ruledata -> timemodified = transform :: datetime ( $ rule -> timemodified ) ; writer :: with_context ( $ context ) -> export_data ( [ get_string ( 'privacy:createdrules' , 'tool_monitor' ) , $ rule -> name . '_' . $ rule -> id ] , $ ruledata ) ; } }
docstring: This formats and then exports the monitor rules.
  
  @param  array $rules The monitor rules.
  @param  context_user $context The user context
docstring_tokens: This formats and then exports the monitor rules .