GetList
Description and parameters
CDBResult CRubric::GetList( array aSort = Array(), array aFilter = Array() );
Method returns list of newsletters by filter. Static method.
Parameters
Parameter | Description | Available from version |
---|---|---|
aSort | Array, containing sorting attribute as set of values "field name"=>"direction". Field name can received the following value:
|
|
aFilter | Array, containing filter as as set of values "field name"=>"filter value". Field name can have the following value:
|
Returned values
Returns a CDBResult result. "Newsletter" field objects become available when retrieving via CDBResult class methods from the result.
Example
<? //get site's newsletter categories $rub = CRubric::GetList(array("SORT"=>"ASC", "NAME"=>"ASC"), array("ACTIVE"=>"Y", "LID"=>LANG)); while($rub->ExtractFields("r_")): ?> <input type="checkbox" name="sf_RUB_ID[]" value="<?echo $r_ID?>"><?echo $r_NAME?><br> <? endwhile; ?>
<? // You can show categories via the following method $arOrder = Array("SORT"=>"ASC", "NAME"=>"ASC"); $arFilter = Array("ACTIVE"=>"Y", "LID"=>LANG); $rsRubric = CRubric::GetList($arOrder, $arFilter); $arRubrics = array(); while($arRubric = $rsRubric->GetNext()) { $arResult["RUBRIC_LIST"][] = $arRubric; } ?>
© «Bitrix24», 2001-2024