original_string: public static function mark_all_conversation_messages_as_read(int $userid, int $conversationid) {
          global $CFG;
  
          // Check if messaging is enabled.
          if (empty($CFG->messaging)) {
              throw new moodle_exception('disabled', 'message');
          }
  
          $params = array(
              'userid' => $userid,
              'conversationid' => $conversationid,
          );
          $params = self::validate_parameters(self::mark_all_conversation_messages_as_read_parameters(), $params);
  
          $context = context_system::instance();
          self::validate_context($context);
  
          $user = core_user::get_user($params['userid'], '*', MUST_EXIST);
          core_user::require_active_user($user);
  
          if (\core_message\api::can_mark_all_messages_as_read($params['userid'], $params['conversationid'])) {
              \core_message\api::mark_all_messages_as_read($params['userid'], $params['conversationid']);
          } else {
              throw new moodle_exception('accessdenied', 'admin');
          }
      }
code: public static function mark_all_conversation_messages_as_read(int $userid, int $conversationid) {
          global $CFG;
  
          // Check if messaging is enabled.
          if (empty($CFG->messaging)) {
              throw new moodle_exception('disabled', 'message');
          }
  
          $params = array(
              'userid' => $userid,
              'conversationid' => $conversationid,
          );
          $params = self::validate_parameters(self::mark_all_conversation_messages_as_read_parameters(), $params);
  
          $context = context_system::instance();
          self::validate_context($context);
  
          $user = core_user::get_user($params['userid'], '*', MUST_EXIST);
          core_user::require_active_user($user);
  
          if (\core_message\api::can_mark_all_messages_as_read($params['userid'], $params['conversationid'])) {
              \core_message\api::mark_all_messages_as_read($params['userid'], $params['conversationid']);
          } else {
              throw new moodle_exception('accessdenied', 'admin');
          }
      }
code_tokens: public static function mark_all_conversation_messages_as_read ( int $ userid , int $ conversationid ) { global $ CFG ; // Check if messaging is enabled. if ( empty ( $ CFG -> messaging ) ) { throw new moodle_exception ( 'disabled' , 'message' ) ; } $ params = array ( 'userid' => $ userid , 'conversationid' => $ conversationid , ) ; $ params = self :: validate_parameters ( self :: mark_all_conversation_messages_as_read_parameters ( ) , $ params ) ; $ context = context_system :: instance ( ) ; self :: validate_context ( $ context ) ; $ user = core_user :: get_user ( $ params [ 'userid' ] , '*' , MUST_EXIST ) ; core_user :: require_active_user ( $ user ) ; if ( \ core_message \ api :: can_mark_all_messages_as_read ( $ params [ 'userid' ] , $ params [ 'conversationid' ] ) ) { \ core_message \ api :: mark_all_messages_as_read ( $ params [ 'userid' ] , $ params [ 'conversationid' ] ) ; } else { throw new moodle_exception ( 'accessdenied' , 'admin' ) ; } }
docstring: Mark all conversation messages as read function.
  
  @param int $userid The user id of who we want to delete the conversation for
  @param int $conversationid The id of the conversations
  @since 3.6
docstring_tokens: Mark all conversation messages as read function .