You are here

function flag_node::get_translation_id in Flag 7.3

Same name and namespace in other branches
  1. 5 flag.inc \flag_node::get_translation_id()
  2. 6.2 flag.inc \flag_node::get_translation_id()
  3. 6 flag.inc \flag_node::get_translation_id()
  4. 7.2 flag.inc \flag_node::get_translation_id()

Adjust the Content ID to find the translation parent if i18n-enabled.

Parameters

int $entity_id: The nid for the content.

Return value

int The tnid if available, the nid otherwise.

2 calls to flag_node::get_translation_id()
flag_node::flag in includes/flag/flag_node.inc
Flags, or unflags, an item.
flag_node::get_flagging_record in includes/flag/flag_node.inc
Returns the flagging record.

File

includes/flag/flag_node.inc, line 96
Contains the flag_node class.

Class

flag_node
Implements a node flag.

Code

function get_translation_id($entity_id) {
  if ($this->i18n) {
    $node = $this
      ->fetch_entity($entity_id);
    if (!empty($node->tnid)) {
      $entity_id = $node->tnid;
    }
  }
  return $entity_id;
}