GetList
Description and parameters
CDBResult CSaleUserAccount::GetList( array arOrder = array(), array arFilter = array(), array arGroupBy = false, array arNavStartParams = false, array arSelectFields = array() );
Method returns a retrieved selection of account records according to its parameters. Non-static method.
Call parameters
Parameter | Description |
---|---|
arOrder | Array, according to which resulting parameters are sorted. Array looks as follows:
array( "field_name1" => "sort_direction1", "field_name2" => "sort_direction2", . . . )Any field can be inserted as the "field_nameN" for payment system handlers. And "sort_directionX" can have values "ASC" (by ascension) and "DESC" (by descension). In case the sort array have several elements, the resulting set is sorted by each element (i. e. first sorts by the first element and then result is sorted by the second element, etc.). Default value - empty array(), in indicating that result won't be sorted. |
arFilter | Array, according to which the payment system entries are filtered. Array looks as follows:
array( "[modifier1][operator1]field_name1" => "value1", "[modifier2][operator2]field_name2" => "value2", . . . )Entries that satisfy the filter are returned in the result and entries that do not satisfy the filter conditions are ignored. The following modifiers are permissible:
Filter example: array("!PERSON_TYPE_ID" => 5)This filter indicates "select all entries with PERSON_TYPE_ID values (payer type code) is not equal to 5". Default value - empty array() - indicates that result won't be filtered. |
arGroupBy | Array with fields used to group entries of payment system handlers. Looks as follows:
array("field_name1", "group_function1" => " field_name2", ...)"field_nameN" can contain any field for payment system handlers. Group function can have:
Default value - false - no grouping of results. |
arNavStartParams | Array with selection parameters. Can contain the following keys:
|
arSelectFields | Array with fields to be returned by the method. Can contain only the required fields. In case the array has the value for
"*", returns all available fields. Default value - array is empty array() - returns all fields of query main table. |
Returned values
Returns CDBResult class object, containing associative arrays with payment system handler parameters with the following keys:
- ID - account ID;
- USER_ID - owner-user ID;
- CURRENT_BUDGET - current amount deposited at the account;
- CURRENCY - currency;
- NOTES - text description;
- LOCKED - flag for locked account;
- TIMESTAMP_X - date of the last update;
- DATE_LOCKED - date of locked account If passes an empty array as the arGroupBy parameter, the method returns the number of entries, satisfying the filter.
Examples
<? // Select all accounts (in different currencies) for user with ID #21 $dbAccountCurrency = CSaleUserAccount::GetList( array(), array("USER_ID" => "21"), false, false, array("CURRENT_BUDGET", "CURRENCY") ); while ($arAccountCurrency = $dbAccountCurrency->Fetch()) { echo "At the account ".$arAccountCurrency["CURRENCY"].": "; echo SaleFormatCurrency($arAccountCurrency["CURRENT_BUDGET"], $arAccountCurrency["CURRENCY"])."<br>"; } // Retrieve the amount of buyer accounts (how much the store owes to customers) $dbAccountCurrency = CSaleUserAccount::GetList( array("CURRENCY" => "ASC"), array(), array("CURRENCY", "SUM" => "CURRENT_BUDGET"), false, array("CURRENCY", "SUM" => "CURRENT_BUDGET") ); while ($arAccountCurrency = $dbAccountCurrency->Fetch()) { echo "В валюте ".$arAccountCurrency["CURRENCY"].": "; echo SaleFormatCurrency($arAccountCurrency["CURRENT_BUDGET"], $arAccountCurrency["CURRENCY"])."<br>"; } ?>
© «Bitrix24», 2001-2024