CDBResult CIBlock::GetList( array arOrder = Array("SORT"=>"ASC"), array arFilter = Array(), bool bIncCnt = false );
Returns a list of information blocks filtered by arFilter and sorted by arOrder.
Parameter | Description |
---|---|
arOrder |
Optional sort order. Array of the format Array(by1=>order1[,
by2=>order2 [, ..]]) where by is the field for
sorting. The field can have the following values:
Default value is Array("sort"=>"asc"). Full list of sorting fields and additional information can be found in CIBlockElement::GetList() |
arFilter |
Optional additional filter by fields in the form of Array("Filter
field"=>"filter values", ...). The Filtering field can be
one of the following:
The "filter values" are a single value or an array. |
bIncCnt |
Specifies that the number of elements of the information block is to be
returned in the field ELEMENT_CNT. Optional. The default value is
false .
|
<? // select all active information blocks of the type catalog of the current site // selection is limited to all blocks with mnemonic code other than my_products, // return the number of active elements. $res = CIBlock::GetList( Array(), Array( 'TYPE'=>'catalog', 'SITE_ID'=>SITE_ID, 'ACTIVE'=>'Y', "CNT_ACTIVE"=>"Y", "!CODE"=>'my_products' ), true ); while($ar_res = $res->Fetch()) { echo $ar_res['NAME'].': '.$ar_res['ELEMENT_CNT']; } ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |