You are here

public function LingotekNode::__get in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.2 lib/Drupal/lingotek/LingotekNode.php \LingotekNode::__get()
  2. 7.3 lib/Drupal/lingotek/LingotekNode.php \LingotekNode::__get()

Magic get for access to node and node properties.

File

lib/Drupal/lingotek/LingotekNode.php, line 162
Defines LingotekNode.

Class

LingotekNode
A class wrapper for Lingotek-specific behavior on nodes.

Code

public function __get($property_name) {
  $property = NULL;
  if ($property === 'node') {
    $property = $this->node;
  }
  elseif (isset($this->node->{$property_name})) {
    $property = $this->node->{$property_name};
  }
  else {

    // attempt to lookup the value in the lingonode table
    $val = lingotek_lingonode($this->node->nid, $property_name);
    $property = $val !== FALSE ? $val : $property;
  }
  return $property;
}