You are here

public function LingotekEntity::__get in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.5 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::__get()
  2. 7.6 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::__get()

Magic get for access to node and node properties.

File

lib/Drupal/lingotek/LingotekEntity.php, line 144
Defines LingotekEntity.

Class

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

Code

public function __get($property_name) {
  $property = NULL;
  if ($property === 'node') {
    $property = $this->entity;
  }
  elseif (isset($this->entity->{$property_name})) {
    $property = $this->entity->{$property_name};
  }
  else {
    $val = lingotek_keystore($this
      ->getEntityType(), $this->entity_id, $property_name);
    $property = $val !== FALSE ? $val : $property;
  }
  return $property;
}