protected function get_discussion($discussionid) {
        global $DB;

        if (empty($this->discussionsdata[$discussionid])) {
            $this->discussionsdata[$discussionid] = $DB->get_record('forum_discussions',
                array('id' => $discussionid), '*', MUST_EXIST);
        }
        return $this->discussionsdata[$discussionid];
    }
protected function get_discussion($discussionid) {
        global $DB;

        if (empty($this->discussionsdata[$discussionid])) {
            $this->discussionsdata[$discussionid] = $DB->get_record('forum_discussions',
                array('id' => $discussionid), '*', MUST_EXIST);
        }
        return $this->discussionsdata[$discussionid];
    }
protected function get_discussion ( $ discussionid ) { global $ DB ; if ( empty ( $ this -> discussionsdata [ $ discussionid ] ) ) { $ this -> discussionsdata [ $ discussionid ] = $ DB -> get_record ( 'forum_discussions' , array ( 'id' => $ discussionid ) , '*' , MUST_EXIST ) ; } return $ this -> discussionsdata [ $ discussionid ] ; }
Returns the discussion checking the internal cache.

@throws \dml_missing_record_exception
@param int $discussionid
@return stdClass
Returns the discussion checking the internal cache .