You are here

private function LingotekConfigSet::__construct in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekConfigSet.php \LingotekConfigSet::__construct()

Constructor.

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

Parameters

$set_id: A Config Set ID.

File

lib/Drupal/lingotek/LingotekConfigSet.php, line 59
Defines LingotekConfigSet.

Class

LingotekConfigSet
A class wrapper for Lingotek-specific behavior on ConfigSets.

Code

private function __construct($set_id = NULL) {
  $this->sid = $set_id;
  $this->set_size = LINGOTEK_CONFIG_SET_SIZE;
  $this->source_data = self::getAllSegments($this->sid);
  $this->source_meta = self::getSetMeta($this->sid);
  $this->language = language_default();
  if (!isset($this->language->lingotek_locale)) {

    // if Drupal variable 'language_default' does not exist
    $this->language->lingotek_locale = Lingotek::convertDrupal2Lingotek($this->language->language);
  }
  $this->language_targets = Lingotek::getLanguagesWithoutSource($this->language->lingotek_locale);
}