GetDiscountCatsList
Description and parameters
CDBResult CCatalogDiscount::GetDiscountCatsList( array arOrder = array(), array arFilter = array(), array arGroupBy = false, array arNavStartParams = false, array arSelectFields = array() );
Method returns a result of retrieved records with information on discounts associated to price types according to its parameters. Non-static method.
Call parameters
Parameter | Description |
---|---|
arOrder | Array, according to which resulting records are sorted. Has the following appearance:
array( "field_name1" => "sort_direction1", "field_name2" => "sort_direction2", . . . )"field_nameN" can have any record field and as "sort_directionX" can have values "ASC" (by ascension) and "DESC" (by descension). In case array with sorting has several elements, resulting set is sorted sequentially by each element (i. e. first sorts by first element and then sorts the result by second element and etc.). Default value - empty array() - result won't be sorted. |
arFilter | Array with parameters to build selection filter. Has the following 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("!DISCOUNT_ID" => 15)This filter indicates "selects all records with value in field DISCOUNT_ID (discount code) is not equal 15". Default value - empty array() - indicates that filter result won't be filtered. |
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 specify only the fields that are required. In case array contains the value "*", returns all the available fields. Default value - empty array() - returns all fields for the main query table. |
Returned values
Returns CDBResult class object, containing set of associative array with keys:
- ID - record code;
- DISCOUNT_ID - discount code;
- CATALOG_GROUP_ID - price type code.
In case arGroupBy is passed as empty, method returns number of records satisfying the filter.
© «Bitrix24», 2001-2024