You are here

public function ActivityActionHandler::determineNid in Activity 7

Return the nid of this Activity.

Parameters

array $objects: An array of objects used in tokenization.

Return value

int / NULL

File

./activity_action_handlers.inc, line 273

Class

ActivityActionHandler

Code

public function determineNid($objects) {
  $nid = NULL;
  if (isset($objects['node']->nid)) {
    $nid = $objects['node']->nid;
  }

  // NOTICE: no elseif(). This is because if the comment is part of the
  // objects, use that as the basis for the nid. Doubt that will ever be an
  // issue.
  if (isset($objects['comment']->nid)) {
    $nid = $objects['comment']->nid;
  }
  return $nid;
}