You are here

private function heartbeatParser::extend_gap_id in Heartbeat 6.3

* Private helper function to build the gap_id

1 call to heartbeatParser::extend_gap_id()
heartbeatParser::prepare_candidates in includes/heartbeatparser.inc
Prepare message candidates This is an important method that handles several things

File

includes/heartbeatparser.inc, line 243

Class

heartbeatParser

Code

private function extend_gap_id(&$gap_id, $message, $type, $set_count) {

  // Extend the gap id with the node_type if available
  if (!empty($message->variables_array['@node_type'])) {
    $gap_id .= '_' . $message->variables_array['@node_type'];
  }

  // group by node will result in a summary of users
  // performing the activity
  if ($message->concat_args['group_by'] == 'node') {
    $gap_id .= '_' . $message->concat_args['group_target'] . '_node_' . $message->nid_target;
  }
  else {
    if ($message->concat_args['group_by'] == 'user') {
      $gap_id .= '_' . $message->concat_args['group_target'] . '_user_' . $message->uid;
    }
    else {
      if ($message->concat_args['group_by'] == 'user-user') {
        $gap_id .= '_user_relation';
        $gap_id .= '_' . $message->uid;
      }
      else {

        // Handle the fall-backs as unique messages
        $gap_id .= '_' . $message->uid . '_' . $message->uid_target;
      }
    }
  }
  return TRUE;
}