GetList
Description and parameters
CDBResult CCatalog::GetList( array arOrder = array(), array arFilter = array(), array arGroupBy = false, array arNavStartParams = false, array arSelectFields = array() );
Method retrieves records from catalog according to its parameters. Non-static method.
Call parameters
Parameter | Description |
---|---|
arOrder | Array to sort resulting records. Array has the appearance:
array( "field_name1" => "sort_direction1", "field_name2" => "sort_direction2", . . . )The "field_nameN" can have any catalog field and as "sort_directionX" can have values "ASC" (by ascension) and "DESC" (by descension). If sorting array has several elements, resulting set is sorted sequentially by each element (i. e. first sorts by the first element, then sorts result by second and etc.). Default value - empty array() - indicates that result won't be sorted. |
arFilter | Array to perform sorting catalog records. Array has appearance:
array( "[modifier1][operator1]field_name1" => "value1", "[modifier2][operator2]field_name2" => "value2", ... )Records that satisfy the filter are returned in the result and records that doesn't satisfy filter conditions are not included. The following modifiers are deemed as permissible:
Filter example: array("SUBSCRIPTION" => "Y")This filter indicates "select all records, for the field SUBSCRIPTION value ("Content selling" flag) is Y". Default value - empty array() - indicates that result is filtered or not. |
arGroupBy | Array with fields for coupon grouping. Has the appearance:
array("field_name1", "field_names", . . .)"field_nameN" can have any catalog field. In case array is empty, method returns number of records satisfying the filter. Default value - false - indicates that the result won't be grouped. |
arNavStartParams | Array with selection parameters. Can contain the following keys:
|
arSelectFields | Array with record fields to be returned by the method. You can indicate only the required fields. When array has the value "*", returns all available fields. Default value - empty array array() - indicates all fields of the main query table to be returned. |
Returned values
Method returns CDBResult class object, containing collection of associative arrays with keys:
Key | Description |
---|---|
ID | Catalog code. Matches with iblock code. |
IBLOCK_ID | Iblock code. |
IBLOCK_TYPE_ID | Iblock type. |
SUBSCRIPTION | Flag "Selling content". |
NAME | Iblock name. |
If passes an empty array as the parameter arGroupBy, the method returns number of records satisfying the filter.
© «Bitrix24», 2001-2024