original_string: public function get_single_discussion_list_renderer(
          forum_entity $forum,
          discussion_entity $discussion,
          bool $hasmultiplediscussions,
          int $displaymode
      ) : discussion_renderer {
  
          $capabilitymanager = $this->managerfactory->get_capability_manager($forum);
          $ratingmanager = $this->managerfactory->get_rating_manager();
          $rendererbase = $this->rendererbase;
  
          $cmid = $forum->get_course_module_record()->id;
          $baseurl = $this->urlfactory->get_forum_view_url_from_course_module_id($cmid);
          $notifications = array();
  
          if ($hasmultiplediscussions) {
              $notifications[] = (new notification(get_string('warnformorepost', 'forum')))
                  ->set_show_closebutton(true);
          }
  
          return new discussion_renderer(
              $forum,
              $discussion,
              $displaymode,
              $rendererbase,
              $this->get_single_discussion_posts_renderer($displaymode, false),
              $this->page,
              $this->legacydatamapperfactory,
              $this->exporterfactory,
              $this->vaultfactory,
              $capabilitymanager,
              $ratingmanager,
              $this->entityfactory->get_exported_posts_sorter(),
              $baseurl,
              $notifications
          );
      }
code: public function get_single_discussion_list_renderer(
          forum_entity $forum,
          discussion_entity $discussion,
          bool $hasmultiplediscussions,
          int $displaymode
      ) : discussion_renderer {
  
          $capabilitymanager = $this->managerfactory->get_capability_manager($forum);
          $ratingmanager = $this->managerfactory->get_rating_manager();
          $rendererbase = $this->rendererbase;
  
          $cmid = $forum->get_course_module_record()->id;
          $baseurl = $this->urlfactory->get_forum_view_url_from_course_module_id($cmid);
          $notifications = array();
  
          if ($hasmultiplediscussions) {
              $notifications[] = (new notification(get_string('warnformorepost', 'forum')))
                  ->set_show_closebutton(true);
          }
  
          return new discussion_renderer(
              $forum,
              $discussion,
              $displaymode,
              $rendererbase,
              $this->get_single_discussion_posts_renderer($displaymode, false),
              $this->page,
              $this->legacydatamapperfactory,
              $this->exporterfactory,
              $this->vaultfactory,
              $capabilitymanager,
              $ratingmanager,
              $this->entityfactory->get_exported_posts_sorter(),
              $baseurl,
              $notifications
          );
      }
code_tokens: public function get_single_discussion_list_renderer ( forum_entity $ forum , discussion_entity $ discussion , bool $ hasmultiplediscussions , int $ displaymode ) : discussion_renderer { $ capabilitymanager = $ this -> managerfactory -> get_capability_manager ( $ forum ) ; $ ratingmanager = $ this -> managerfactory -> get_rating_manager ( ) ; $ rendererbase = $ this -> rendererbase ; $ cmid = $ forum -> get_course_module_record ( ) -> id ; $ baseurl = $ this -> urlfactory -> get_forum_view_url_from_course_module_id ( $ cmid ) ; $ notifications = array ( ) ; if ( $ hasmultiplediscussions ) { $ notifications [ ] = ( new notification ( get_string ( 'warnformorepost' , 'forum' ) ) ) -> set_show_closebutton ( true ) ; } return new discussion_renderer ( $ forum , $ discussion , $ displaymode , $ rendererbase , $ this -> get_single_discussion_posts_renderer ( $ displaymode , false ) , $ this -> page , $ this -> legacydatamapperfactory , $ this -> exporterfactory , $ this -> vaultfactory , $ capabilitymanager , $ ratingmanager , $ this -> entityfactory -> get_exported_posts_sorter ( ) , $ baseurl , $ notifications ) ; }
docstring: Create a single type discussion list renderer.
  
  @param forum_entity $forum Forum the discussion belongs to
  @param discussion_entity $discussion The discussion entity
  @param bool $hasmultiplediscussions Whether the forum has multiple discussions (more than one)
  @param int $displaymode How should the posts be formatted?
  @return discussion_renderer
docstring_tokens: Create a single type discussion list renderer .