Bitrix Site Manager

CStatEvent::Add

int
CStatEvent::Add(
 int type_id,
 string event3,
 string date,
 string gid,
 mixed money = "",
 string currency = "",
 string chargeback = "N"
)

The method Add adds an event of the specified type using information contained in the special parameter.

Parameters

Parameter Description
type_id The event type ID.
event3 The event auxiliary parameter event3.
date Date in the current time.
gid Special parameter containing all information (in the encoded form) required to add the event.
money Amount of money.
currency Three-character currency identifier. Currency identifiers are defined in the Currencies module.
chargeback Indicates a negative amount ("N"). Used in situations when a chargeback event occurs. Possible values:
  • Y - the amount is negative;
  • N - the amount is positive.

Return Values

Returns the ID of the added event on success, or 0 (null) otherwise.

See Also

Example



<?
// add an event of the type #1
// the type must be created in advance

// special parameter in readable form
$gid = "BITRIX_SM.995.82.N0.25.N.ru"; 

// date in the format of the current site or language
$date = "23.12.2005 18:15:10";

CStatEvent::Add(1, "", $date, $gid, 99, "USD");
?>

<?
// add an event of the type #2
// the type must be created in advance

// special parameter in encoded form
$gid = "BITRIX_SM.OTk1LjgyLk4wLjI1Lk4ucnU%3D";

// date in the format of the current site or language
$date = "01.06.2005";

CStatEvent::Add(2, "", $date, $gid, "199", "EUR");
?>