Documentation

GetList

Description and parameters

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

Method returns retrieved data entries containing information about renewed subscription according to its parameters. Non-static method.

Call parameters

ParameterDescription
arOrder Array, according to which resulting entries are sorted. Array looks as follows:
array(
	"module_name1" => "sort_direction1",
	"module_fields2" => "sort_direction2",
	. . .
)
Any field can be set as "field_nameN" with details on renewed subscription, and values "ASC" (by ascension) и "DESC" (by descension) can be "sort_directionX" могут быть значения .

If sorting array has several elements, the resulting set is sorted by each element (i. e. initially sorts by the first element, then the result is sorted by the second, etc.). 

Default value - empty array() - indicates that result won't be sorted.
arFilter Array that filters subscription extension information. Array has the following structure:
array(
	"[modifier1][operator1]field_name1" => "value1",
	"[modifier2][operator2]field_name2" => "value2",
	. . .
)
Entries that satisfy filter are returned in the result, and entries, which does not satisfy filter conditions - are rejected.

The following modifiers are permissible:
  • ! - negation;
  • + - null, 0 and empty string values also satisfy filter conditions.
The following operators are permissible:
  • >= - field value is larger or equal to value passed to filter;
  • > - field value is strictly larger than the value passed to filter;
  • <= - field value is less or equal to the value passed to filter;
  • < - field value is strictly less of the value passed to filter;
  • @ - field value is included into a comma-separated list entry, passed to the filter. You can pass a standard array as usual.
  • ~ - field value is checked for a match to the template passed to filter;
  • % - field value is checked for a match to a string passed to filter according to query language.
Any field can be set as "field_nameX" with information on renewed subscription.

Filter example:
array(
	"USER_ID" => 150
)
This filter indicates "select all entries with field value USER_ID (user code) equals 150".

Default value - empty array() indicates that result won't be filtered.
arGroupBy Array with fields used to group entries with subscription extension details. Array looks as follows:
array(
	"field_name1", 
	"group_function2" => "field_name2", 
	. . .
)
Any field can be set in "field_nameN" with information on renewed subscription. The following values can be specified as a group function:
  • COUNT - quantity count;
  • AVG - average value calculation;
  • MIN - minimum value calculation;
  • MAX - maximum value calculation;
  • SUM - total sum calculation.
In case array is empty, the method returns number of entries, satisfying the filter.

Default value - false - indicates that result won't be grouped.
arNavStartParams Array with selection parameters. Can contain the following keys:
  • "nTopCount" - number of entries returned by the method will be limited at the top value specified in this key;
  • any key, accepted by the method CDBResult::NavQuery as a third parameter.
Default value - false - indicates no parameters in the selection.
arSelectFields Array with entry fields to be returned by the method. You can specify only the fields that are required. In case array contains the value "*", returns all available fields.

Default field - empty array array() - indicates that all fields from the main query table will be returned.

Returned values

Returns CDBResult class object, containing set of associative arrays with parameters on subscription extension.

  • ID - entry ID;
  • USER_ID - user ID;
  • MODULE - module with renewed product;
  • PRODUCT_ID - renewed product ID;
  • PRODUCT_NAME - renewed product name;
  • PRODUCT_URL - link to renewed product;
  • RECUR_SCHEME_TYPE - type of payment period;
  • RECUR_SCHEME_LENGTH - payment period length;
  • WITHOUT_ORDER - "Renewal without ordering" flag;
  • ORDER_ID - base order ID for renewal;
  • CANCELED - canceled renewal flag;
  • DESCRIPTION - description;
  • CALLBACK_FUNC - callback function for renewal parameter update;
  • REMAINING_ATTEMPTS - number of remaining attempts for renewal;
  • SUCCESS_PAYMENT - successful renewal;
  • CANCELED_REASON - cancellation reason;
  • DATE_CANCELED - date of cancellation;
  • PRIOR_DATE - date of the last renewal;
  • NEXT_DATE - date of next renewal;
  • TIMESTAMP_X - date of the last entry update;
  • USER_LOGIN - user login;
  • USER_ACTIVE - user active flag;
  • USER_NAME - user name;
  • USER_LAST_NAME - user last name;
  • USER_EMAIL - user e-mail.

In case an empty parameter is passed as arGroupBy, method returns a number of entries, satisfying the filter.



© «Bitrix24», 2001-2024