view core/modules/locale/src/SourceString.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
line wrap: on
line source
<?php

namespace Drupal\locale;

/**
 * Defines the locale source string object.
 *
 * This class represents a module-defined string value that is to be translated.
 * This string must at least contain a 'source' field, which is the raw source
 * value, and is assumed to be in English language.
 */
class SourceString extends StringBase {

  /**
   * {@inheritdoc}
   */
  public function isSource() {
    return isset($this->source);
  }

  /**
   * {@inheritdoc}
   */
  public function isTranslation() {
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getString() {
    return isset($this->source) ? $this->source : '';
  }

  /**
   * {@inheritdoc}
   */
  public function setString($string) {
    $this->source = $string;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function isNew() {
    return empty($this->lid);
  }

}