You are here

protected function CommentActivityActionHandler::getUid in Activity 7

Return the user id that matches the provided key in the templates.

Parameters

string $key: The message key.

array $objects: All the objects for the Activity.

Return value

int

Overrides ActivityActionHandler::getUid

File

./activity_action_handlers.inc, line 679

Class

CommentActivityActionHandler
Activity handler for the comment module. Extends the node handler has it presents a lot of the same things, just more.

Code

protected function getUid($key, $objects) {
  if ($key == 'public') {
    return 0;
  }
  elseif ($key == 'current_user') {
    return $GLOBALS['user']->uid;
  }
  elseif ($key == 'node_comment' && $objects['node']->uid == $objects['comment']->uid) {
    return $objects['comment']->uid;
  }
  if (isset($objects[$key]) && isset($objects[$key]->uid)) {
    return $objects[$key]->uid;
  }
  return FALSE;
}