Bitrix Site Manager

CStatEvent::AddByEvents

int
CStatEvent::AddByEvents(
 string event1,
 string event2,
 string event3,
 string date,
 string gid,
 mixed money = "",
 string currency = "",
 string chargeback = "N"
)

The method AddByEvents adds an event by the specified event type identifiers and a special parameter. If no event type with identifiers event1, event2 exists, it will be automatically created.

Parameters

Parameter Description
event1 The event1 event type identifier.
event2 The event2 event type identifier.
event3 The event auxiliary parameter event3.
date Date in the current format.
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 softkey/buy
// if it does not exist, it will be created

// 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::AddByEvents("softkey", "buy", "", $date, $gid, "899", "USD");
?>

<?
// add an event of the type regnow/buy
// if it does not exist, it will be created

// 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::AddByEvents("regnow", "buy", "", $date, $gid, "199", "EUR");
?>