original_string: public function delete_data_for_users_in_context(\core_privacy\local\request\userlist_collection $collection) {
          $progress = static::get_log_tracer();
  
          $a = (object) [
              'contextid' => $collection->get_context()->id,
              'total' => count($collection),
              'progress' => 0,
              'component' => '',
              'datetime' => userdate(time()),
          ];
  
          // Delete the data.
          $progress->output(get_string('trace:deletingapprovedusers', 'core_privacy', $a), 1);
          foreach ($collection as $userlist) {
              if (!$userlist instanceof \core_privacy\local\request\approved_userlist) {
                  throw new \moodle_exception('The supplied userlist must be an approved_userlist');
              }
  
              $component = $userlist->get_component();
              $a->component = $component;
              $a->progress++;
              $a->datetime = userdate(time());
  
              if (empty($userlist)) {
                  // This really shouldn't happen!
                  continue;
              }
  
              $progress->output(get_string('trace:processingcomponent', 'core_privacy', $a), 2);
  
              $this->handled_component_class_callback($component, core_userlist_provider::class,
                      'delete_data_for_users', [$userlist]);
          }
  
          $progress->output(get_string('trace:done', 'core_privacy'), 1);
      }
code: public function delete_data_for_users_in_context(\core_privacy\local\request\userlist_collection $collection) {
          $progress = static::get_log_tracer();
  
          $a = (object) [
              'contextid' => $collection->get_context()->id,
              'total' => count($collection),
              'progress' => 0,
              'component' => '',
              'datetime' => userdate(time()),
          ];
  
          // Delete the data.
          $progress->output(get_string('trace:deletingapprovedusers', 'core_privacy', $a), 1);
          foreach ($collection as $userlist) {
              if (!$userlist instanceof \core_privacy\local\request\approved_userlist) {
                  throw new \moodle_exception('The supplied userlist must be an approved_userlist');
              }
  
              $component = $userlist->get_component();
              $a->component = $component;
              $a->progress++;
              $a->datetime = userdate(time());
  
              if (empty($userlist)) {
                  // This really shouldn't happen!
                  continue;
              }
  
              $progress->output(get_string('trace:processingcomponent', 'core_privacy', $a), 2);
  
              $this->handled_component_class_callback($component, core_userlist_provider::class,
                      'delete_data_for_users', [$userlist]);
          }
  
          $progress->output(get_string('trace:done', 'core_privacy'), 1);
      }
code_tokens: public function delete_data_for_users_in_context ( \ core_privacy \ local \ request \ userlist_collection $ collection ) { $ progress = static :: get_log_tracer ( ) ; $ a = ( object ) [ 'contextid' => $ collection -> get_context ( ) -> id , 'total' => count ( $ collection ) , 'progress' => 0 , 'component' => '' , 'datetime' => userdate ( time ( ) ) , ] ; // Delete the data. $ progress -> output ( get_string ( 'trace:deletingapprovedusers' , 'core_privacy' , $ a ) , 1 ) ; foreach ( $ collection as $ userlist ) { if ( ! $ userlist instanceof \ core_privacy \ local \ request \ approved_userlist ) { throw new \ moodle_exception ( 'The supplied userlist must be an approved_userlist' ) ; } $ component = $ userlist -> get_component ( ) ; $ a -> component = $ component ; $ a -> progress ++ ; $ a -> datetime = userdate ( time ( ) ) ; if ( empty ( $ userlist ) ) { // This really shouldn't happen! continue ; } $ progress -> output ( get_string ( 'trace:processingcomponent' , 'core_privacy' , $ a ) , 2 ) ; $ this -> handled_component_class_callback ( $ component , core_userlist_provider :: class , 'delete_data_for_users' , [ $ userlist ] ) ; } $ progress -> output ( get_string ( 'trace:done' , 'core_privacy' ) , 1 ) ; }
docstring: Delete all user data for all specified users in a context.
  
  @param   \core_privacy\local\request\userlist_collection $collection
docstring_tokens: Delete all user data for all specified users in a context .