original_string: protected static function export_user_data_lti_tool_proxies(approved_contextlist $contextlist) {
          global $DB;
  
          // Filter out any contexts that are not related to system context.
          $systemcontexts = array_filter($contextlist->get_contexts(), function($context) {
              return $context->contextlevel == CONTEXT_SYSTEM;
          });
  
          if (empty($systemcontexts)) {
              return;
          }
  
          $user = $contextlist->get_user();
  
          $systemcontext = \context_system::instance();
  
          $data = [];
          $ltiproxies = $DB->get_recordset('lti_tool_proxies', ['createdby' => $user->id], 'timecreated ASC');
          foreach ($ltiproxies as $ltiproxy) {
              $data[] = [
                  'name' => format_string($ltiproxy->name, true, $systemcontext),
                  'createdby' => transform::user($ltiproxy->createdby),
                  'timecreated' => transform::datetime($ltiproxy->timecreated),
                  'timemodified' => transform::datetime($ltiproxy->timemodified)
              ];
          }
          $ltiproxies->close();
  
          $finaldata = (object) ['lti_tool_proxies' => $data];
          writer::with_context($systemcontext)->export_data([], $finaldata);
      }
code: protected static function export_user_data_lti_tool_proxies(approved_contextlist $contextlist) {
          global $DB;
  
          // Filter out any contexts that are not related to system context.
          $systemcontexts = array_filter($contextlist->get_contexts(), function($context) {
              return $context->contextlevel == CONTEXT_SYSTEM;
          });
  
          if (empty($systemcontexts)) {
              return;
          }
  
          $user = $contextlist->get_user();
  
          $systemcontext = \context_system::instance();
  
          $data = [];
          $ltiproxies = $DB->get_recordset('lti_tool_proxies', ['createdby' => $user->id], 'timecreated ASC');
          foreach ($ltiproxies as $ltiproxy) {
              $data[] = [
                  'name' => format_string($ltiproxy->name, true, $systemcontext),
                  'createdby' => transform::user($ltiproxy->createdby),
                  'timecreated' => transform::datetime($ltiproxy->timecreated),
                  'timemodified' => transform::datetime($ltiproxy->timemodified)
              ];
          }
          $ltiproxies->close();
  
          $finaldata = (object) ['lti_tool_proxies' => $data];
          writer::with_context($systemcontext)->export_data([], $finaldata);
      }
code_tokens: protected static function export_user_data_lti_tool_proxies ( approved_contextlist $ contextlist ) { global $ DB ; // Filter out any contexts that are not related to system context. $ systemcontexts = array_filter ( $ contextlist -> get_contexts ( ) , function ( $ context ) { return $ context -> contextlevel == CONTEXT_SYSTEM ; } ) ; if ( empty ( $ systemcontexts ) ) { return ; } $ user = $ contextlist -> get_user ( ) ; $ systemcontext = \ context_system :: instance ( ) ; $ data = [ ] ; $ ltiproxies = $ DB -> get_recordset ( 'lti_tool_proxies' , [ 'createdby' => $ user -> id ] , 'timecreated ASC' ) ; foreach ( $ ltiproxies as $ ltiproxy ) { $ data [ ] = [ 'name' => format_string ( $ ltiproxy -> name , true , $ systemcontext ) , 'createdby' => transform :: user ( $ ltiproxy -> createdby ) , 'timecreated' => transform :: datetime ( $ ltiproxy -> timecreated ) , 'timemodified' => transform :: datetime ( $ ltiproxy -> timemodified ) ] ; } $ ltiproxies -> close ( ) ; $ finaldata = ( object ) [ 'lti_tool_proxies' => $ data ] ; writer :: with_context ( $ systemcontext ) -> export_data ( [ ] , $ finaldata ) ; }
docstring: Export personal data for the given approved_contextlist related to LTI tool proxies.
  
  @param approved_contextlist $contextlist a list of contexts approved for export.
docstring_tokens: Export personal data for the given approved_contextlist related to LTI tool proxies .