Documentation

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:
  • s_id - web form ID;
  • s_sort - sorting index;
  • s_name - web form title;
  • s_sid - web form symbolic ID.
оrder Reference to the variable with sorting index. It can have the following values:
  • asc - by ascension;
  • desc - by descension.
filter Array for filtration. The array can have the following keys:
  • ID* - web form ID (precise match will be searched by default);
  • ID_EXACT_MATCH - if set to "N", an occurrence will be searched when filtering by ID;
  • SID* - web form symbolic identifier (precise match will be searched by default);
  • SID_EXACT_MATCH - if set to "N", an occurrence will be searched when filtering by SID;
  • NAME* - web form title (an occurrence will be searched by default);
  • NAME_EXACT_MATCH - if set to "Y", precise match will be searched when filtering by NAME;
  • DESCRIPTION* - web form description (an occurrence will be searched by default);
  • DESCRIPTION_EXACT_MATCH - if set to "Y", precise match will be searched when filtering by DESCRIPTION;
  • SITE* - site ID or site IDs array to which web form is attached (precise match will be searched by default);
  • SITE_EXACT_MATCH - if set to "N", an occurrence will be searched when filtering by SITE.
* - complex logic is allowed
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
Up