Bitrix Site Manager

CAdvContract::GetList

record set
CAdvContract::GetList(
 varchar &by,
 varchar &order,
 array arFilter=array(),
 boolean &is_filtered
);

The method GetList obtains a list of contracts. 

Parameters

by
The field ID by which the sorting is performed. The following values are possible:
  • s_id - by the ID
  • s_lamp - by the contract indicator;
  • s_name - by the contract name;
  • s_description - by the contract description;
  • s_active - by the active state flag;
  • s_weight - by the weight;
  • s_sort - by the sorting;
  • s_date_modify - by the date of modification;
  • s_modified_by - by the ID of the user who modified the contract;
  • s_banner_count - by the number of banners assigned to the contract;
  • s_ctr - by the contract CTR;
  • s_show_count - by the total number of the contract banner shows;
  • s_max_show_count - by the maximum total number of the contract banner shows;
  • s_click_count - by the total number of contract banner clicks;
  • s_max_click_count - by the maximum total number of contract banner clicks.
order
Sort order. The following values are possible:
  • desc - descending (default)
  • asc - ascending
arFilter
An array used to filter the values. The following keys are possible in this array:
  • ID - contract ID (complex logic can be used);
  • ID_EXACT_MATCH - set to "Y" for exact match searches when filtering by the contract ID (default). If "N", the method performs loose searches (entry is sufficient);
  • LAMP - the indicator value: "red" or "green";
  • DATE_MODIFY_1 - lower bound of the date range when the contract could be modified;
  • DATE_MODIFY_2 - upper bound of the date range when the contract could be modified;
  • NAME - contract name (complex logic can be used);
  • NAME_EXACT_MATCH - set to "Y" for exact match searches when filtering by the contract name. If "N", the method performs loose searches (default);
  • DESCRIPTION - contract description (complex logic can be used);
  • DESCRIPTION_EXACT_MATCH - set to "Y" for exact match searches when filtering by the contract description. If "N", the method performs loose searches (default);
  • OWNER - ID, user first and last names, login of the contract owner (complex logic can be used);
  • OWNER_EXACT_MATCH - set to "Y" for exact match searches when filtering by the ID, user first and last names and login of the contract owner. If "N", the method performs loose searches (default);
  • BANNER_COUNT_1 - lower bound of the range of contract banners count;
  • BANNER_COUNT_2 - upper bound of the range of contract banners count;
  • SHOW_COUNT_1 - lower bound of the range of the total number of contract banner shows;
  • SHOW_COUNT_2 - upper bound of the range of the total number of contract banner shows;
  • CLICK_COUNT_1 - lower bound of the range of the total count of contract banner clicks;
  • CLICK_COUNT_2 - upper bound of the range of the total count of contract banner clicks;
  • CTR_1 - lower bound of the contract CTR range;
  • CTR_2 - upper bound of the contract CTR range;
  • ADMIN_COMMENTS - contract administrative comment (complex logic can be used);
  • ADMIN_COMMENTS_EXACT_MATCH - set to "Y" for exact match searches when filtering by the contract administrative comment. If "N", the method performs loose searches (default).
is_filtered
On return, this variable contains true if the returned list of contracts is filtered by any above criteria, or false otherwise.

Example


<?
// filter
$FilterArr = Array(
	"find_id",
	"find_id_exact_match",
	"find_date_modify_1", 
	"find_date_modify_2", 
	"find_name",
	"find_name_exact_match",
	"find_description", 
	"find_description_exact_match",
	"find_lamp", 
	"find_owner",
	"find_owner_exact_match",
	"find_banner_count_1",
	"find_banner_count_2",
	"find_show_count_1",
	"find_show_count_2",
	"find_click_count_1",
	"find_click_count_2",
	"find_ctr_1",
	"find_ctr_2",
	"find_admin_comments",
	"find_admin_comments_exact_match"
	);
if (strlen($set_filter)>0) InitFilterEx($FilterArr,"ADV_CONTRACT_LIST","set"); 
else InitFilterEx($FilterArr,"ADV_CONTRACT_LIST","get");
if (strlen($del_filter)>0) DelFilterEx($FilterArr,"ADV_CONTRACT_LIST");
InitBVar($find_id_exact_match);
InitBVar($find_name_exact_match);
InitBVar($find_description_exact_match);
InitBVar($find_owner_exact_match);
InitBVar($find_admin_comments_exact_match);
$arFilter = Array(
	"ID"                            => $find_id,
	"ID_EXACT_MATCH"                => $find_id_exact_match,
	"DATE_MODIFY_1"                 => $find_date_modify_1, 
	"DATE_MODIFY_2"                 => $find_date_modify_2, 
	"NAME"                          => $find_name,
	"NAME_EXACT_MATCH"              => $find_name_exact_match,
	"DESCRIPTION"                   => $find_description,
	"DESCRIPTION_EXACT_MATCH"       => $find_description_exact_match,
	"LAMP"                          => $find_lamp,
	"OWNER"                         => $find_owner,
	"OWNER_EXACT_MATCH"             => $find_owner_exact_match,
	"BANNER_COUNT_1"                => $find_banner_count_1,
	"BANNER_COUNT_2"                => $find_banner_count_2,
	"SHOW_COUNT_1"                  => $find_show_count_1,
	"SHOW_COUNT_2"                  => $find_show_count_2,
	"CLICK_COUNT_1"                 => $find_click_count_1,
	"CLICK_COUNT_2"                 => $find_click_count_2,
	"CTR_1"                         => $find_ctr_1,
	"CTR_2"                         => $find_ctr_2,
	"ADMIN_COMMENTS"                => $find_admin_comments,
	"ADMIN_COMMENTS_EXACT_MATCH"    => $find_admin_comments_exact_match
	);
$rsAdvContract = CAdvContract::GetList($by, $order, $arFilter, $is_filtered);
?>

Example.

The following is the sample array obtained by fetching a row of selection returned by this function.

<?
Array
(
    [LAMP] => green
    [ID] => 3
    [ACTIVE] => Y
    [NAME] => contract name
    [DESCRIPTION] => contract description
    [ADMIN_COMMENTS] => administrative comment
    [WEIGHT] => 1000
    [SORT] => 200
    [MAX_SHOW_COUNT] => 1000
    [SHOW_COUNT] => 312
    [MAX_CLICK_COUNT] => 100
    [CLICK_COUNT] => 64
    [EMAIL_COUNT] => 0
    [CREATED_BY] => 2
    [MODIFIED_BY] => 2
    [DEFAULT_STATUS_SID] => READY
    [CTR] => 20.51
    [DATE_SHOW_FROM] => 15.06.2004
    [DATE_SHOW_TO] => 07.07.2009
    [DATE_CREATE] => 07.06.2004 19:04:55
    [DATE_MODIFY] => 24.06.2004 10:56:08
    [BANNER_COUNT] => 12
)
?>