Bitrix Site Manager

CStatEventType::GetList

CDBResult
CStatEventType::GetList(
 string &by = "s_today_counter",
 string &order = "desc",
 array filter = array(),
 bool &is_filtered,
 mixed limit = false
)

The method GetList returns a list of event types.

Parameters

Parameter Description
by Sorting field; possible values:
  • s_id - the event type ID;
  • s_date_last - the date of the last event of this type;
  • s_date_enter - the date of the first event of this type;
  • s_today_counter - number of events of this type for today;
  • s_yesterday_counter - number of events of this type for yesterday;
  • s_b_yesterday_counter - number of events of this type for day before yesterday;
  • s_total_counter - total number of events of this type;
  • s_period_counter - number of events of this type for the specified period (filter[DATE1_PERIOD], filter[DATE2_PERIOD]);
  • s_name - the event type name;
  • s_event1 - the event1 identifier of the event type;
  • s_event2 - the event2 identifier of the event type;
  • s_event12 - sort by "EVENT1, EVENT2";
  • s_chart - sort by "DIAGRAM_DEFAULT desc, TOTAL_COUNTER";
  • s_stat - sort by "TODAY_COUNTER desc, YESTERDAY_COUNTER desc, B_YESTERDAY_COUNTER desc, TOTAL_COUNTER desc, PERIOD_COUNTER".
order Sort order; the following values are possible:
  • asc - ascending;
  • desc - descending.
filter Array used to filter the resulting list. The following keys can be used in the array:
  • ID* - the event type ID;
  • ID_EXACT_MATCH - if "N", entry in the ID is sufficient (loose match);
  • EVENT1* - the event1 event type identifier;
  • EVENT1_EXACT_MATCH - if "Y", the EVENT1 must match exactly (strict match);
  • EVENT2* - the event2 event type identifier;
  • EVENT2_EXACT_MATCH - if "Y", the EVENT2 must match exactly (strict match);
  • NAME* - the event type name;
  • NAME_EXACT_MATCH - if "Y", the NAME must match exactly (strict match);
  • DESCRIPTION* - the event type description;
  • DESCRIPTION_EXACT_MATCH - if "Y", the DESCRIPTION must match exactly (strict match);
  • DATE_ENTER_1 - the earliest date when the first event of the required type occurred;
  • DATE_ENTER_2 - the latest date when the first event of the required type occurred;
  • DATE_LAST_1 - the earliest date when the last event of the required type occurred;
  • DATE_LAST_2 - the latest date when the last event of the required type occurred;
  • DATE1_PERIOD - the earliest date of an arbitrary period;
  • DATE2_PERIOD - the latest date of an arbitrary period;
  • COUNTER1 - minimum value of the range to match against the field "total number of events of this type";
  • COUNTER2 - maximum value of the range to match against the field "total number of events of this type";
  • ADV_VISIBLE - flag: whether to include information on this event type in the advertising campaign report [Y/N];
  • DIAGRAM_DEFAULT - flag: whether to include this event type in charts and graphs by default [Y/N];
  • KEEP_DAYS1 - minimum value of the range to match against the field "days to keep events of this type";
  • KEEP_DAYS2 - maximum value of the range to match against the field "days to keep events of this type";
  • DYNAMIC_KEEP_DAYS1 - minimum value of the range to match against the field "days to keep information on events of this type on daily basis";
  • DYNAMIC_KEEP_DAYS2 - maximum value of the range to match against the field "days to keep information on events of this type on daily basis";
  • MONEY1 - minimum value of amount of money of the events of this type;
  • MONEY2 - maximum value of amount of money of the events of this type;
  • CURRENCY - three-character identifier of the amount currency;
  • GROUP - how to group the resulting list; possible values:
    • event1 - grouping by event1;
    • event2 - grouping by event2.
* - complex logic allowed.
is_filtered If this flag contains "true" on return, the resulting list is filtered.
limit Maximum number of event types to return. If set to false, the number of event types will be limited to that specified in the parameter Maximum number of records displayed in tables in the Statistics module settings.

Structure of the returned record

Depending on how the list is grouped, the returned record structure may vary.

See Also

Example



<?
// obtain information only on those event types
// whose event1 = "download"
// also obtain extra data on December 2005
$arFilter = array(
    "DATE1_PERIOD" => "01.12.2005",
    "DATE2_PERIOD" => "31.12.2005",
    "EVENT1"       => "download"
    );

// obtain the list of records
$rs = CStatEventType::GetList(
    ($by = "s_today_counter"), 
    ($order = "desc"), 
    $arFilter, 
    $is_filtered
    );

// print all records
while ($ar = $rs->Fetch())
{
    echo "<pre>"; print_r($ar); echo "</pre>";    
}
?>