public function TranslationString::__construct

Overrides Drupal\locale\StringBase::__construct().

Overrides StringBase::__construct

File

drupal/core/modules/locale/lib/Drupal/locale/TranslationString.php, line 50
Definition of Drupal\locale\TranslationString.

Class

TranslationString
Defines the locale translation string object.

Namespace

Drupal\locale

Code

public function __construct($values = array()) {
  parent::__construct($values);
  if (!isset($this->is_new)) {

    // We mark the string as not new if it is a complete translation.
    // This will work when loading from database, otherwise the storage
    // controller that creates the string object must handle it.
    $this->is_new = !$this
      ->isTranslation();
  }
}