Documentation

GetList

Description and parameters

record set
CTicketDictionary::GetList(

 varchar &by,
 varchar &order,
 array arFilter=array(),
 boolean &is_filtered

);

Method is designed for getting list of directory entries. Non-static method.

Method parameters

ParameterDescription
by Identifier specifying a name for field for sorting. The following values are permitted:
  • s_id - by ID
  • s_c_sort - by specified sorting order
  • s_sid - by symbolic code
  • s_lis - by language
  • s_name - by name
  • s_responsible - by responsible ID
  • s_dropdown - by indicated sorting order and by name
order Sorting order. The following values are permitted:
  • desc - by descension (default value)
  • asc - by ascension
arFilter Array for filtering values. Array permits the following indexes:
  • ID - entry ID (complex logic is permitted)
  • SID - symbolic code (complex logic is permitted)
  • LID - site ID
  • TYPE - entry type: "C" - category, "C" - criticality, "S" - status, "R" - reply/answer rating, "F" - most frequent answers, "SR" - source
  • NAME - name (complex logic is permitted)
  • RESPONSIBLE_ID - responsible ID
  • RESPONSIBLE - responsible user, searches by user ID, login, first, last name (complex logic is permitted)
  • DEFAULT - flag "select by default"; "Y" - yes, "N" - no
Optional parameter.
is_filtered Variable returns true in case list of results is filtered by a criteria; or false otherwise. Replaced with isFiltered starting from version 12.0.0.

Returned value

Returns object CDBResult.

Example

<?
$FilterArr = Array(
	"find_id",
	"find_lid",
	"find_type",
	"find_name",
	"find_sid",
	"find_responsible",
	"find_responsible_id",
	"find_default"
	);
if (strlen($set_filter)>0) InitFilterEx($FilterArr,"TICKET_DICTIONARY_LIST","set"); else InitFilterEx($FilterArr,"TICKET_DICTIONARY_LIST","get");
if (strlen($del_filter)>0) DelFilterEx($FilterArr,"TICKET_DICTIONARY_LIST");
$arFilter = Array(
	"ID"				=> $find_id,
	"LID"				=> $find_lid,
	"TYPE"				=> $find_type,
	"NAME"				=> $find_name,
	"SID"				=> $find_sid,
	"RESPONSIBLE_ID"	=> $find_responsible_id,
	"RESPONSIBLE"		=> $find_responsible,
	"DEFAULT"			=> $find_default
	);
$tdic = CTicketDictionary::GetList($by, $order, $arFilter, $is_filtered);
?>

//get list of status for current site $arFilter = Array(
	"LID" => SITE_ID,
	"TYPE" => "S",
);

//sorting is specified via variables
$by = "s_c_sort";
$sort = "asc";

//sort and print
$rsStatus = CTicketDictionary::GetList($by, $sort, $arFilter, $is_filtered); while($arRes = $rsStatus->GetNext()) {
	echo $arRes["NAME"], "";
}

© «Bitrix24», 2001-2024
Up