Documentation

CForumTopic::GetListEx

CDBResult
GetListEx(
 [array arOrder [,
 array arFilter [,
 bool bCount [,
 int iNum]]]]
);

The method GetListEx returns a filtered and sorted list of topics including all bound data.

Parameters

ParameterDescription
arOrder An array of the format Array(by1=>order1[, by2=>order2 [, ..]])
This parameter is detailed in CForumTopic::GetList.
arFilter An array of the format array("filter field"=>"filter value" [, ...]).
This parameter is detailed in CForumTopic::GetList.
bCount If parameter is true, only the number of topics that conforms to the specified filter is returned.
Optional. The default value is false.
iNum Maximum number of records returned. If the parameter iNum is not zero, a maximum of iNum records is returned. Not all databases support this feature. If the feature is not supported, this parameter is ignored. Optional. The default value is 0.

Return Values

Returns an instance of the CDBResult class. 

See Also

  • CDBResult
  • Topic fields

    Example


    
    <?
    // Select all the published topics of the forum $FID,
    // that were sorted first by sort index,
    // then by the date of the last message in the topic
    $db_res = CForumTopic::GetList(array("SORT"=>"ASC", 
                                         "LAST_POST_DATE"=>"DESC"),
                                   array("FORUM_ID"=>$FID));
    while ($ar_res = $db_res->Fetch())
    {
      echo "<pre>";
      print_r($ar_res);
      echo "</pre><br>";
    }
    ?>
  • © «Bitrix24», 2001-2024
    Up