You are here

public function TranslationString::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/TranslationString.php \Drupal\locale\TranslationString::__construct()

Constructs a new locale string object.

Parameters

object|array $values: Object or array with initial values.

Overrides StringBase::__construct

File

core/modules/locale/src/TranslationString.php, line 50
Contains \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->isNew)) {

    // 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->isNew = !$this
      ->isTranslation();
  }
}