record set CFormResult::GetList( int FORM_ID, varchar &by, varchar &order, array arFilter=array(), boolean &is_filtered char(1) CHECK_RIGHTS="Y" );
The method is used to get a list of form results with respect to the current user permissions. The list returned is the selection from the database (a record set) with the result fields. Use the function CForm::GetResultAnswerArray get the form questions, fields and their values.
Parameter | Description |
---|---|
FORM_ID | Form ID. |
by | Allows to specify the name of the field
by which the sorting is to be performed. The following values allowed:
|
order | Sort order. The following values apply:
|
arFilter | Array used as the values filter. The
following key names apply:
|
is_filtered | Contains true on return if the results has been filtered, or false otherwise. |
CHECK_RIGHTS | If set to "Y", user permissions will be checked when adding a result. If "N", no checks are performed. |
Sample PHP code used to define the array arFilter:
$arFilter = array( "ID" => "1 | 2" "STATUS_ID" => "9 | 10", "TIMESTAMP_1" => "10.10.2003", "TIMESTAMP_2" => "15.10.2003", "DATE_CREATE_1" => "10.10.2003", "DATE_CREATE_2" => "12.10.2003", "REGISTERED" => "Y", "USER_AUTH" => "N", "USER_ID" => "45 | 35", "USER_ID_EXACT_MATCH" => "Y", // match ID or login name exactly "GUEST_ID" => "4456 | 7768", "SESSION_ID" => "456456 | 778768", "FIELDS" => array( 0 => array( "CODE" => "GAME_ID", // code of the filtering field "FILTER_TYPE" => "integer", // filter by integer field "PARAMETER_NAME" => "USER", // filter by user text "VALUE" => $arGame["ID"], // value to filter by "PART" => 0 // exact match ), 1 => array( "CODE" => "GAME_NAME", // code of the filtering field "FILTER_TYPE" => "text", // filter by integer field "PARAMETER_NAME" => "USER", // filter by user text "VALUE" => "Tetris", // value to filter by "EXACT_MATCH" => "Y" // exact match ) 2 => array( "CODE" => "GENRE_ID", // code of the filtering field "FILTER_TYPE" => "integer", // filter by integer field "PARAMETER_NAME" => "ANSWER_VALUE", // filter by ANSWER_VALUE "VALUE" => "3", // value to filter by "PART" => 1 // from ), 3 => array( "CODE" => "GENRE_ID", // code of the filtering field "FILTER_TYPE" => "integer", // filter by integer field "PARAMETER_NAME" => "ANSWER_VALUE", // filter by ANSWER_VALUE "VALUE" => "6", // value to filter by "PART" => 2 // to ) ) );
$arFilter = array( "STATUS_ID" => "9 | 10", // filter results with status 9 or 10 "FIELDS" => array( 0 => array( "CODE" => "GAME_ID", // code of the filtering field "FILTER_TYPE" => "integer", // filter as integer "PARAMETER_NAME" => "USER", // filter by user text "VALUE" => $arGame["ID"], // value to filter by "PART" => 0 // exact match ), ) ); $rsComments = CFormResult::GetList($arForm["ID"], ($by="s_timestamp"), ($order="desc"), $arFilter, $is_filtered);
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |