Documentation

GetList

CCatalogStore::GetList(
 array arOrder = array(),
 array arFilter = array(),
 array arGroupBy = false,
 array arNavStartParams = false,
 array arSelectFields = array()
);

Returns a retrieved records from table with warehouses according to parameters. Static method.

Call parameters

ParameterDescription
arOrder Array for sorting resulting records. Has the following format:
array(

"field_name" => "sorting_direction",

"field_name" => "sorting_direction",

. . .

)
It can have any field as "field_nameN", and as "sorting_directionX" can have values "ASC" (by ascension) and "DESC" (by descension).

In case the array has several elements, the resulting set is sorted sequentially by each element (i. e. first sorted by the first element and then sorted by second element and etc.). 

Default value - empty array() - indicates that result won't be sorted.
arFilter Array, according to which the records are sorted. Array has the format:
array(
"[modifier1][operator1]field_name1" => "value1",

"[modifier2][operator2] field_name2" => "value2",
. . .
)
Records, satisfying the records are returned in the result, and records that do not satisfy filter conditions are disregarded.

The following modifiers are permitted:
  • ! - negation;
  • + - null, 0 and empty string also satisfy filter conditions.
The following operators are permitted:
  • >= - field value is greater than or equal to value passed to filter;
  • > - field value is greater than value passed to filter;
  • <= - field value less than or equal to value passed filter;
  • < - field value is strictly less than value passed to filter;
  • @ - operator can use integer and real data when passing set of values (array). In this case, uses SQL operator IN that passes compact record format when generating a SQL query;
  • ~ - field value is checked for a match to a template passed to filter;
  • % - field value is checked for a match to a string according to the query language.
Any field can be set as "field_nameX".

Filter example:
array("ACTIVE" => "Y")
This filter means "select all records with ACTIVE field (flag "Warehouse active") is Y".

Default value - empty array() - indicates no filtering for the result.
arGroupBy Array with fields used for record grouping. Array has the format as follows:
array("field_name1", "field_name2", . . .)
The "field_nameN" can have any field.

In case an array is empty, the method returns set of records satisfying the filter.

Default value - false - indicates no grouping for the result.
arNavStartParams Array with retrieved selection parameters. Can contain the following keys:
  • "nTopCount" - number of records returned by the method limited at the top by this key value;
  • any keys, received by method CDBResult::NavQuery as a third parameter.
Default value - false - indicates no fetched parameters.
arSelectFields Array with record fields to be returned by the method. Can indicate only the fields that are required. If array has the value "*", returns all available fields.

Default value - empty array() - indicates that all fields for query's main table will be returned.

Returned value

Returns object of class CDBResult, containing collection of associative array with keys.



© «Bitrix24», 2001-2024
Up