You are here

final class Locale in Price 8

Same name and namespace in other branches
  1. 3.x src/Locale.php \Drupal\price\Locale
  2. 2.0.x src/Locale.php \Drupal\price\Locale
  3. 2.x src/Locale.php \Drupal\price\Locale
  4. 3.0.x src/Locale.php \Drupal\price\Locale

Represents a locale.

Hierarchy

Expanded class hierarchy of Locale

1 file declares its use of Locale
DefaultLocaleResolver.php in src/Resolver/DefaultLocaleResolver.php

File

src/Locale.php, line 8

Namespace

Drupal\price
View source
final class Locale {

  /**
   * The locale.
   *
   * @var string
   */
  protected $localeCode;

  /**
   * Constructs a new Locale object.
   *
   * @param string $locale_code
   *   The locale code.
   */
  public function __construct($locale_code) {
    $this->localeCode = $locale_code;
  }

  /**
   * Gets the locale code.
   *
   * @return string
   *   The locale code.
   */
  public function getLocaleCode() {
    return $this->localeCode;
  }

  /**
   * Gets the string representation of the locale.
   *
   * @return string
   *   The string representation of the locale.
   */
  public function __toString() {
    return $this->localeCode;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Locale::$localeCode protected property The locale.
Locale::getLocaleCode public function Gets the locale code.
Locale::__construct public function Constructs a new Locale object.
Locale::__toString public function Gets the string representation of the locale.