public function get_from_forum_id(
        int $forumid,
        bool $includehiddendiscussions,
        ?int $includepostsforuser,
        ?int $sortorder,
        int $limit,
        int $offset
    ) {
        $alias = $this->get_table_alias();
        $wheresql = "{$alias}.forum = :forumid";
        [
            'wheresql' => $hiddensql,
            'params' => $hiddenparams
        ] = $this->get_hidden_post_sql($includehiddendiscussions, $includepostsforuser);
        $wheresql .= $hiddensql;

        $params = array_merge($hiddenparams, [
            'forumid' => $forumid,
        ]);

        $includefavourites = $includepostsforuser ? true : false;
        $sql = $this->generate_get_records_sql($wheresql, $this->get_sort_order($sortorder, $includefavourites),
            $includepostsforuser);
        $records = $this->get_db()->get_records_sql($sql, $params, $offset, $limit);

        return $this->transform_db_records_to_entities($records);
    }
public function get_from_forum_id(
        int $forumid,
        bool $includehiddendiscussions,
        ?int $includepostsforuser,
        ?int $sortorder,
        int $limit,
        int $offset
    ) {
        $alias = $this->get_table_alias();
        $wheresql = "{$alias}.forum = :forumid";
        [
            'wheresql' => $hiddensql,
            'params' => $hiddenparams
        ] = $this->get_hidden_post_sql($includehiddendiscussions, $includepostsforuser);
        $wheresql .= $hiddensql;

        $params = array_merge($hiddenparams, [
            'forumid' => $forumid,
        ]);

        $includefavourites = $includepostsforuser ? true : false;
        $sql = $this->generate_get_records_sql($wheresql, $this->get_sort_order($sortorder, $includefavourites),
            $includepostsforuser);
        $records = $this->get_db()->get_records_sql($sql, $params, $offset, $limit);

        return $this->transform_db_records_to_entities($records);
    }
public function get_from_forum_id ( int $ forumid , bool $ includehiddendiscussions , ? int $ includepostsforuser , ? int $ sortorder , int $ limit , int $ offset ) { $ alias = $ this -> get_table_alias ( ) ; $ wheresql = "{$alias}.forum = :forumid" ; [ 'wheresql' => $ hiddensql , 'params' => $ hiddenparams ] = $ this -> get_hidden_post_sql ( $ includehiddendiscussions , $ includepostsforuser ) ; $ wheresql .= $ hiddensql ; $ params = array_merge ( $ hiddenparams , [ 'forumid' => $ forumid , ] ) ; $ includefavourites = $ includepostsforuser ? true : false ; $ sql = $ this -> generate_get_records_sql ( $ wheresql , $ this -> get_sort_order ( $ sortorder , $ includefavourites ) , $ includepostsforuser ) ; $ records = $ this -> get_db ( ) -> get_records_sql ( $ sql , $ params , $ offset , $ limit ) ; return $ this -> transform_db_records_to_entities ( $ records ) ; }
Get each discussion, first post, first and last post author for the given forum, considering timed posts, and
pagination.

@param   int         $forumid The forum to fetch the discussion set for
@param   bool        $includehiddendiscussions Whether to include hidden discussions or not
@param   int|null    $includepostsforuser Which user to include posts for, if any
@param   int         $sortorder The sort order to use
@param   int         $limit The number of discussions to fetch
@param   int         $offset The record offset
@return  array       The set of data fetched
Get each discussion first post first and last post author for the given forum considering timed posts and pagination .