ICanBoogie/CLDR v1.4.1
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • CLDR

Classes

  • Calendar
  • CalendarCollection
  • Currency
  • CurrencyCollection
  • CurrencyFormatter
  • DateFormatter
  • DateTimeFormatter
  • FileProvider
  • ListFormatter
  • Locale
  • LocaleCollection
  • LocalizedCurrency
  • LocalizedDateTime
  • LocalizedListFormatter
  • LocalizedLocale
  • LocalizedNumberFormatter
  • LocalizedObject
  • LocalizedObjectWithFormatter
  • LocalizedTerritory
  • NumberFormatter
  • NumberPattern
  • Numbers
  • ProviderCollection
  • RedisProvider
  • Repository
  • RunTimeProvider
  • Supplemental
  • Territory
  • TerritoryCollection
  • TimeFormatter
  • WebProvider

Interfaces

  • Exception
  • Formatter
  • LocalizeAwareInterface
  • Provider

Traits

  • CodePropertyTrait
  • CollectionTrait
  • LocalePropertyTrait
  • ProviderStorageBinding
  • RepositoryPropertyTrait

Exceptions

  • ResourceNotFound
  • TerritoryNotDefined
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 
<?php

/*
 * This file is part of the ICanBoogie package.
 *
 * (c) Olivier Laviale <olivier.laviale@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ICanBoogie\CLDR;

use ICanBoogie\Accessor\AccessorTrait;

/**
 * Representation of a locale numbers
 *
 * @property-read Locale $locale
 * @property-read array $symbols Shortcuts to the `symbols-numberSystem-<defaultNumberingSystem>`.
 * @property-read array $decimal_formats Shortcuts to the `decimalFormats-numberSystem-<defaultNumberingSystem>`.
 * @property-read string $decimal_format Shortcuts to the `decimalFormats-numberSystem-<defaultNumberingSystem>/standard`.
 * @property-read array $short_decimal_formats Shortcuts to the `decimalFormats-numberSystem-<defaultNumberingSystem>/short/decimalFormats`.
 * @property-read array $long_decimal_formats Shortcuts to the `decimalFormats-numberSystem-<defaultNumberingSystem>/long/decimalFormats`.
 * @property-read array $scientific_formats Shortcuts to the `scientificFormats-numberSystem-<defaultNumberingSystem>`.
 * @property-read array $percent_formats Shortcuts to the `percentFormats-numberSystem-<defaultNumberingSystem>`.
 * @property-read array $currency_formats Shortcuts to the `currencyFormats-numberSystem-<defaultNumberingSystem>`.
 * @property-read array $misc_patterns Shortcuts to the `miscPatterns-numberSystem-<defaultNumberingSystem>`.
 */
class Numbers extends \ArrayObject
{
    use AccessorTrait;
    use LocalePropertyTrait;

    protected function get_symbols()
    {
        return $this['symbols-numberSystem-' . $this['defaultNumberingSystem']];
    }

    protected function get_decimal_formats()
    {
        return $this['decimalFormats-numberSystem-' . $this['defaultNumberingSystem']];
    }

    protected function get_decimal_format()
    {
        return $this['decimalFormats-numberSystem-' . $this['defaultNumberingSystem']]['standard'];
    }

    protected function get_short_decimal_formats()
    {
        return $this['decimalFormats-numberSystem-' . $this['defaultNumberingSystem']]['short']['decimalFormat'];
    }

    protected function get_long_decimal_formats()
    {
        return $this['decimalFormats-numberSystem-' . $this['defaultNumberingSystem']]['long']['decimalFormat'];
    }

    protected function get_scientific_formats()
    {
        return $this['scientificFormats-numberSystem-' . $this['defaultNumberingSystem']];
    }

    protected function get_percent_formats()
    {
        return $this['percentFormats-numberSystem-' . $this['defaultNumberingSystem']];
    }

    protected function get_currency_formats()
    {
        return $this['currencyFormats-numberSystem-' . $this['defaultNumberingSystem']];
    }

    protected function get_misc_patterns()
    {
        return $this['miscPatterns-numberSystem-' . $this['defaultNumberingSystem']];
    }

    /**
     * Initialize the {@link $locale} property.
     *
     * @param Locale $locale
     * @param array $data
     */
    public function __construct(Locale $locale, array $data)
    {
        $this->locale = $locale;

        parent::__construct($data);
    }
}
ICanBoogie/CLDR v1.4.1 API documentation generated by ApiGen