original_string: protected static function export_discussion_subscription_data(int $userid, \context_module $context, \stdClass $discussion) {
          $area = static::get_discussion_area($discussion);
          if (null !== $discussion->preference) {
              // The user has a specific subscription preference for this discussion.
              $a = (object) [];
  
              switch ($discussion->preference) {
                  case \mod_forum\subscriptions::FORUM_DISCUSSION_UNSUBSCRIBED:
                      $a->preference = get_string('unsubscribed', 'mod_forum');
                      break;
                  default:
                      $a->preference = get_string('subscribed', 'mod_forum');
                      break;
              }
  
              writer::with_context($context)
                  ->export_metadata(
                      $area,
                      'subscriptionpreference',
                      $discussion->preference,
                      get_string('privacy:discussionsubscriptionpreference', 'mod_forum', $a)
                  );
  
              return true;
          }
  
          return true;
      }
code: protected static function export_discussion_subscription_data(int $userid, \context_module $context, \stdClass $discussion) {
          $area = static::get_discussion_area($discussion);
          if (null !== $discussion->preference) {
              // The user has a specific subscription preference for this discussion.
              $a = (object) [];
  
              switch ($discussion->preference) {
                  case \mod_forum\subscriptions::FORUM_DISCUSSION_UNSUBSCRIBED:
                      $a->preference = get_string('unsubscribed', 'mod_forum');
                      break;
                  default:
                      $a->preference = get_string('subscribed', 'mod_forum');
                      break;
              }
  
              writer::with_context($context)
                  ->export_metadata(
                      $area,
                      'subscriptionpreference',
                      $discussion->preference,
                      get_string('privacy:discussionsubscriptionpreference', 'mod_forum', $a)
                  );
  
              return true;
          }
  
          return true;
      }
code_tokens: protected static function export_discussion_subscription_data ( int $ userid , \ context_module $ context , \ stdClass $ discussion ) { $ area = static :: get_discussion_area ( $ discussion ) ; if ( null !== $ discussion -> preference ) { // The user has a specific subscription preference for this discussion. $ a = ( object ) [ ] ; switch ( $ discussion -> preference ) { case \ mod_forum \ subscriptions :: FORUM_DISCUSSION_UNSUBSCRIBED : $ a -> preference = get_string ( 'unsubscribed' , 'mod_forum' ) ; break ; default : $ a -> preference = get_string ( 'subscribed' , 'mod_forum' ) ; break ; } writer :: with_context ( $ context ) -> export_metadata ( $ area , 'subscriptionpreference' , $ discussion -> preference , get_string ( 'privacy:discussionsubscriptionpreference' , 'mod_forum' , $ a ) ) ; return true ; } return true ; }
docstring: Store data about whether the user subscribes to this particular discussion.
  
  @param   int         $userid The userid of the user whose data is to be exported.
  @param   \context_module $context The instance of the forum context.
  @param   \stdClass   $discussion The discussion whose data is being exported.
  @return  bool        Whether any data was stored.
docstring_tokens: Store data about whether the user subscribes to this particular discussion .