original_string: public function get_from_discussion_id(
          stdClass $user,
          int $discussionid,
          bool $canseeprivatereplies,
          string $orderby = 'created ASC'
      ) : array {
          $alias = $this->get_table_alias();
  
          [
              'where' => $privatewhere,
              'params' => $privateparams,
          ] = $this->get_private_reply_sql($user, $canseeprivatereplies);
  
          $wheresql = "{$alias}.discussion = :discussionid {$privatewhere}";
          $orderbysql = $alias . '.' . $orderby;
  
          $sql = $this->generate_get_records_sql($wheresql, $orderbysql);
          $records = $this->get_db()->get_records_sql($sql, array_merge([
              'discussionid' => $discussionid,
          ], $privateparams));
  
          return $this->transform_db_records_to_entities($records);
      }
code: public function get_from_discussion_id(
          stdClass $user,
          int $discussionid,
          bool $canseeprivatereplies,
          string $orderby = 'created ASC'
      ) : array {
          $alias = $this->get_table_alias();
  
          [
              'where' => $privatewhere,
              'params' => $privateparams,
          ] = $this->get_private_reply_sql($user, $canseeprivatereplies);
  
          $wheresql = "{$alias}.discussion = :discussionid {$privatewhere}";
          $orderbysql = $alias . '.' . $orderby;
  
          $sql = $this->generate_get_records_sql($wheresql, $orderbysql);
          $records = $this->get_db()->get_records_sql($sql, array_merge([
              'discussionid' => $discussionid,
          ], $privateparams));
  
          return $this->transform_db_records_to_entities($records);
      }
code_tokens: public function get_from_discussion_id ( stdClass $ user , int $ discussionid , bool $ canseeprivatereplies , string $ orderby = 'created ASC' ) : array { $ alias = $ this -> get_table_alias ( ) ; [ 'where' => $ privatewhere , 'params' => $ privateparams , ] = $ this -> get_private_reply_sql ( $ user , $ canseeprivatereplies ) ; $ wheresql = "{$alias}.discussion = :discussionid {$privatewhere}" ; $ orderbysql = $ alias . '.' . $ orderby ; $ sql = $ this -> generate_get_records_sql ( $ wheresql , $ orderbysql ) ; $ records = $ this -> get_db ( ) -> get_records_sql ( $ sql , array_merge ( [ 'discussionid' => $ discussionid , ] , $ privateparams ) ) ; return $ this -> transform_db_records_to_entities ( $ records ) ; }
docstring: Get the post ids for the given discussion.
  
  @param stdClass $user The user to check the unread count for
  @param int $discussionid The discussion to load posts for
  @param bool $canseeprivatereplies Whether this user can see all private replies or not
  @param string $orderby Order the results
  @return post_entity[]
docstring_tokens: Get the post ids for the given discussion .