original_string: public function get_from_discussion_ids(stdClass $user, array $discussionids, bool $canseeprivatereplies) : array {
          if (empty($discussionids)) {
              return [];
          }
  
          $alias = $this->get_table_alias();
  
          list($insql, $params) = $this->get_db()->get_in_or_equal($discussionids, SQL_PARAMS_NAMED);
          [
              'where' => $privatewhere,
              'params' => $privateparams,
          ] = $this->get_private_reply_sql($user, $canseeprivatereplies);
  
          $wheresql = "{$alias}.discussion {$insql} {$privatewhere}";
  
          $sql = $this->generate_get_records_sql($wheresql, '');
          $records = $this->get_db()->get_records_sql($sql, array_merge($params, $privateparams));
  
          return $this->transform_db_records_to_entities($records);
      }
code: public function get_from_discussion_ids(stdClass $user, array $discussionids, bool $canseeprivatereplies) : array {
          if (empty($discussionids)) {
              return [];
          }
  
          $alias = $this->get_table_alias();
  
          list($insql, $params) = $this->get_db()->get_in_or_equal($discussionids, SQL_PARAMS_NAMED);
          [
              'where' => $privatewhere,
              'params' => $privateparams,
          ] = $this->get_private_reply_sql($user, $canseeprivatereplies);
  
          $wheresql = "{$alias}.discussion {$insql} {$privatewhere}";
  
          $sql = $this->generate_get_records_sql($wheresql, '');
          $records = $this->get_db()->get_records_sql($sql, array_merge($params, $privateparams));
  
          return $this->transform_db_records_to_entities($records);
      }
code_tokens: public function get_from_discussion_ids ( stdClass $ user , array $ discussionids , bool $ canseeprivatereplies ) : array { if ( empty ( $ discussionids ) ) { return [ ] ; } $ alias = $ this -> get_table_alias ( ) ; list ( $ insql , $ params ) = $ this -> get_db ( ) -> get_in_or_equal ( $ discussionids , SQL_PARAMS_NAMED ) ; [ 'where' => $ privatewhere , 'params' => $ privateparams , ] = $ this -> get_private_reply_sql ( $ user , $ canseeprivatereplies ) ; $ wheresql = "{$alias}.discussion {$insql} {$privatewhere}" ; $ sql = $ this -> generate_get_records_sql ( $ wheresql , '' ) ; $ records = $ this -> get_db ( ) -> get_records_sql ( $ sql , array_merge ( $ params , $ privateparams ) ) ; return $ this -> transform_db_records_to_entities ( $ records ) ; }
docstring: Get the list of posts for the given discussions.
  
  @param stdClass $user The user to check the unread count for
  @param int[] $discussionids The list of discussion ids to load posts for
  @param bool $canseeprivatereplies Whether this user can see all private replies or not
  @return post_entity[]
docstring_tokens: Get the list of posts for the given discussions .