GetList
CDBResult CForm::GetList( string &by = "s_sort", string &order = "asc", array filter = array(), bool &is_filtered, int min_permission = 10 )
The method returns list of web forms as a CDBResult class object. Non-static method.
Method parameters
Parameter | Description |
---|---|
by | Link to variable with sorting field. It can have the following values:
|
оrder | Reference to the variable with sorting index. It can have the following values:
|
filter | Array for filtration. The array can have the following keys:
|
is_filtered | Reference to variable that stores the flag of the filtered web form list. If set to "true", the list was filtered. |
min_permission | Minimum level of web form access permissions. Optional parameter. By default - 2. For version 4.0.4 - 10 (permission to fill out web forms and create new results). |
See Also
- [link=90286]CForm fields[/link]
- [link=90282#form]Web form access permissions[/link]
- [link=90290]CForm::GetByID[/link]
- [link=90291]CForm::GetBySID[/link]
Examples of use
<? // generate filter array $arFilter = Array( "ID" => "1 | 2", // ID=1 or ID=2 "ID_EXACT_MATCH" => "Y", // precise match by ID "NAME" => "FORM", // web form title has the word "Form" "NAME_EXACT_MATCH" => "N", // incomplete match by NAME "SID" => "FORM", // symbolic identifier equal to FORM "SID_EXACT_MATCH" => "Y", // precise match by SID "DESCRIPTION" => "fill out", // description contains the word "fill out" "DESCRIPTION_EXACT_MATCH" => "N", // incomplete match by DESCRIPTION "SITE" => array("r1", "e2") // web form is attached to sites r1, e2 ); // get the list of all forms the user has access permissions to fill out $rsForms = CForm::GetList($by="s_id", $order="desc", $arFilter, $is_filtered); while ($arForm = $rsForms->Fetch()) { echo "<pre>"; print_r($arForm); echo "</pre>"; } ?>
© «Bitrix24», 2001-2024