original_string: protected static function export_digest_data(int $userid, \stdClass $forum, int $maildigest) {
          if (null !== $maildigest) {
              // The user has a specific maildigest preference for this forum.
              $a = (object) [
                  'forum' => format_string($forum->name, true),
              ];
  
              switch ($maildigest) {
                  case 0:
                      $a->type = get_string('emaildigestoffshort', 'mod_forum');
                      break;
                  case 1:
                      $a->type = get_string('emaildigestcompleteshort', 'mod_forum');
                      break;
                  case 2:
                      $a->type = get_string('emaildigestsubjectsshort', 'mod_forum');
                      break;
              }
  
              writer::with_context(\context_module::instance($forum->cmid))
                  ->export_metadata([], 'digestpreference', $maildigest,
                      get_string('privacy:digesttypepreference', 'mod_forum', $a));
  
              return true;
          }
  
          return false;
      }
code: protected static function export_digest_data(int $userid, \stdClass $forum, int $maildigest) {
          if (null !== $maildigest) {
              // The user has a specific maildigest preference for this forum.
              $a = (object) [
                  'forum' => format_string($forum->name, true),
              ];
  
              switch ($maildigest) {
                  case 0:
                      $a->type = get_string('emaildigestoffshort', 'mod_forum');
                      break;
                  case 1:
                      $a->type = get_string('emaildigestcompleteshort', 'mod_forum');
                      break;
                  case 2:
                      $a->type = get_string('emaildigestsubjectsshort', 'mod_forum');
                      break;
              }
  
              writer::with_context(\context_module::instance($forum->cmid))
                  ->export_metadata([], 'digestpreference', $maildigest,
                      get_string('privacy:digesttypepreference', 'mod_forum', $a));
  
              return true;
          }
  
          return false;
      }
code_tokens: protected static function export_digest_data ( int $ userid , \ stdClass $ forum , int $ maildigest ) { if ( null !== $ maildigest ) { // The user has a specific maildigest preference for this forum. $ a = ( object ) [ 'forum' => format_string ( $ forum -> name , true ) , ] ; switch ( $ maildigest ) { case 0 : $ a -> type = get_string ( 'emaildigestoffshort' , 'mod_forum' ) ; break ; case 1 : $ a -> type = get_string ( 'emaildigestcompleteshort' , 'mod_forum' ) ; break ; case 2 : $ a -> type = get_string ( 'emaildigestsubjectsshort' , 'mod_forum' ) ; break ; } writer :: with_context ( \ context_module :: instance ( $ forum -> cmid ) ) -> export_metadata ( [ ] , 'digestpreference' , $ maildigest , get_string ( 'privacy:digesttypepreference' , 'mod_forum' , $ a ) ) ; return true ; } return false ; }
docstring: Store data about daily digest preferences
  
  @param   int         $userid The userid of the user whose data is to be exported.
  @param   \stdClass   $forum The forum whose data is being exported.
  @param   int         $maildigest The mail digest setting for this forum.
  @return  bool        Whether any data was stored.
docstring_tokens: Store data about daily digest preferences