1<?php 2/** 3 * Created by PhpStorm. 4 * User: thomasleviandier 5 * Date: 2018-12-20 6 * Time: 16:44 7 */ 8 9namespace PrestaShop\PrestaShop\Core\Localization\CLDR; 10 11use PrestaShop\PrestaShop\Core\Localization\Exception\LocalizationException; 12 13/** 14 * CLDR Currency entity. This is an immutable data object. 15 * 16 * This class represents the immutable object of CLDR data for a specific currency, translated in a given language. 17 * It is the only data object visible and handleable by "outside" code (meaning non-CLDR code). 18 * CLDR Locale objects aggregate multiple CLDR Currency instances (available currencies), and return this class when 19 * asked for a given currency. 20 */ 21interface CurrencyInterface 22{ 23 public const SYMBOL_TYPE_NARROW = 'narrow'; 24 public const DISPLAY_NAME_COUNT_DEFAULT = 'default'; 25 public const SYMBOL_TYPE_DEFAULT = 'default'; 26 public const DISPLAY_NAME_COUNT_ONE = 'one'; 27 public const DISPLAY_NAME_COUNT_OTHER = 'other'; 28 29 /** 30 * Get the ISO code of this currency. 31 * 32 * @return string 33 * The currency's ISO 4217 code 34 */ 35 public function getIsoCode(); 36 37 /** 38 * Get the numeric ISO code of this currency. 39 * 40 * @return string 41 * The currency's ISO 4217 numeric code 42 */ 43 public function getNumericIsoCode(); 44 45 /** 46 * Get the number of decimal digits to display when formatting a price with this currency. 47 * 48 * @return int 49 * The number of decimal digits to display 50 */ 51 public function getDecimalDigits(); 52 53 /** 54 * Get the display name for the passed count context. 55 * 56 * @param string $countContext 57 * The count context 58 * "default" = talking about the currency (e.g.: "used currency is Euro") 59 * "one" = talking about one unit of this currency (e.g.: "one euro") 60 * "other" = talking about several units of this currency (e.g.: "ten euros") 61 * 62 * @return string 63 * The wanted display name 64 */ 65 public function getDisplayName($countContext = self::DISPLAY_NAME_COUNT_DEFAULT); 66 67 /** 68 * Get the symbol of this currency. Narrow symbol is returned by default. 69 * 70 * @param string $type 71 * Possible value: "default" ("$") and "narrow" ("US$") 72 * 73 * @return string 74 * The currency's symbol 75 * 76 * @throws LocalizationException 77 * When an invalid symbol type is passed 78 */ 79 public function getSymbol($type = self::SYMBOL_TYPE_NARROW); 80} 81