You are here

private function LingotekConfigSet::__construct in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 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();

  // INT-791 Respecting the i18n_string_source_language setting
  $i18n_language = variable_get('i18n_string_source_language', language_default()->language);
  $this->language->language = $i18n_language;
  $this->language->lingotek_locale = Lingotek::convertDrupal2Lingotek($this->language->language);
  $this->language_targets = Lingotek::getLanguagesWithoutSource($this->language->lingotek_locale);
}