function heartbeat_log in Heartbeat 6.4
Same name and namespace in other branches
- 6.3 heartbeat.module \heartbeat_log()
- 7 heartbeat.module \heartbeat_log()
User activity logger function
Parameters
The data to add one row:
1 call to heartbeat_log()
- heartbeat_api_log in ./
heartbeat.module - API function to log a message from custom code
File
- ./
heartbeat.module, line 1320
Code
function heartbeat_log($data, $args = array()) {
global $user;
// Relational message of heartbeat messages
$row = heartbeat_message_load($data['message_id'], 'message_id');
$template = new HeartbeatMessageTemplate($row->hid, $row->message_id, $row->message, $row->message_concat, $row->concat_args);
$data = $data + (array) $row;
$heartbeatactivity = new HeartbeatActivity($data, $template);
// Get the first logged entry ID.
$saved = $heartbeatactivity
->save($args);
module_invoke_all('heartbeat_activity_log', $heartbeatactivity, $args);
return $saved;
}