protected function Analytic::writeEventRecord in Analytics 6
Store the analytic data for an event.
Parameters
$ip_address:
$unique_id:
Return value
unknown_type
1 call to Analytic::writeEventRecord()
- Analytic::track in includes/
analytic.inc - Primary function to record a data point.
File
- includes/
analytic.inc, line 173 - Class definition for analytics.
Class
- Analytic
- @file Class definition for analytics.
Code
protected function writeEventRecord($ip_address, $unique_id = NULL) {
$event_instance_id = db_insert('analytics_event_instance')
->fields(array(
'event_id' => $this->event_id,
'date' => date('Y-m-d H:i:s'),
'year' => date('Y'),
'month' => date('n'),
'week' => date('W'),
'ip' => $ip_address,
'unique_id' => $unique_id,
))
->execute();
$query = db_insert('analytics_property_values')
->fields(array(
'property_id',
'event_instance_id',
'value',
));
foreach ($this
->getProperties() as $item) {
$query
->values(array(
'property_id' => $item['property_id'],
'event_instance_id' => $event_instance_id,
'value' => $item['data'],
));
}
$query
->execute();
}