You are here

private function LingotekEntity::__construct in Lingotek Translation 7.7

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

Constructor.

This is private since we want consumers to instantiate via the factory methods.

Parameters

object $node: A Drupal node.

File

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

Class

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

Code

private function __construct($entity, $entity_type) {
  $this->entity = $entity;
  $this->entity_type = $entity_type;
  $this->entity_id = $this
    ->getId();
  $this->info = entity_get_info($this->entity_type);
  if (!empty($entity->language_override)) {
    $this
      ->setLanguage($entity->language_override);
  }
  else {
    $this
      ->setLanguage();
  }
}