Bitrix Site Manager

CAdvType::GetList

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

The method GetList is intended for obtaining a list of banner types.

Parameters

by
The field ID by which the sorting is performed. The following values are possible:
  • s_sid - by symbolic type ID;
  • s_date_modify - by the date of modification;
  • s_modified_by - by the ID of a user who has modified the type;
  • s_date_create - by the date of creation;
  • s_created_by - by the ID of a user who has created the type;
  • s_active - by the active state flag;
  • s_name - by name;
  • s_banners - by the number of banners of this type;
  • s_description - by description.
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:
  • SID - symbolic type ID (complex logic can be used);
  • SID_EXACT_MATCH - set to "Y" for exact match searches when filtering by the symbolic type ID (default). If "N", the method performs loose searches (entry is sufficient);    
  • DATE_MODIFY_1 - lower bound of the date range when the type could be modified;
  • DATE_MODIFY_2 - upper bound of the date range when the type could be modified;
  • ACTIVE - active state flag: if "Y", the type is active, if "N" the type is inactive;
  • NAME - name of type (complex logic can be used);
  • NAME_EXACT_MATCH - set to "Y" for exact match searches when filtering by the name of type. If "N", the method performs loose searches (default);
  • DESCRIPTION - description of type (complex logic can be used);
  • DESCRIPTION_EXACT_MATCH - set to "Y" for exact match searches when filtering by the description of type. If "N", the method performs loose searches (default).
is_filtered
On return, this variable contains true if the returned list of types is filtered by any above criteria, or false otherwise.

Example


<?
$FilterArr = Array(
	"find_sid",
	"find_sid_exact_match",
	"find_date_modify_1", 
	"find_date_modify_2", 
	"find_active", 
	"find_name",
	"find_name_exact_match",
	"find_description", 
	"find_description_exact_match"
	);
if (strlen($set_filter)>0) InitFilterEx($FilterArr,"ADV_TYPE_LIST","set"); 
else InitFilterEx($FilterArr,"ADV_TYPE_LIST","get");
if (strlen($del_filter)>0) DelFilterEx($FilterArr,"ADV_TYPE_LIST");
InitBVar($find_sid_exact_match);
InitBVar($find_name_exact_match);
InitBVar($find_description_exact_match);
$arFilter = Array(
	"SID"                       => $find_sid,
	"SID_EXACT_MATCH"           => $find_sid_exact_match,
	"DATE_MODIFY_1"             => $find_date_modify_1, 
	"DATE_MODIFY_2"             => $find_date_modify_2, 
	"ACTIVE"                    => $find_active, 
	"NAME"                      => $find_name,
	"NAME_EXACT_MATCH"          => $find_name_exact_match,
	"DESCRIPTION"               => $find_description,
	"DESCRIPTION_EXACT_MATCH"   => $find_description_exact_match,
	);
$rsAdvType = CAdvType::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
(
    [SID] => TOP
    [ACTIVE] => Y
    [SORT] => 10
    [NAME] => Top banner
    [DESCRIPTION] => description of type
    [DATE_CREATE] => 03.06.2004 17:27:00
    [DATE_MODIFY] => 03.06.2004 17:27:00
    [CREATED_BY] => 2
    [MODIFIED_BY] => 2
    [BANNER_COUNT] => 63
)
?>