class NumberFormatterFactory in Price 8
Same name and namespace in other branches
- 3.x src/NumberFormatterFactory.php \Drupal\price\NumberFormatterFactory
- 3.0.x src/NumberFormatterFactory.php \Drupal\price\NumberFormatterFactory
Defines the NumberFormatter factory.
Hierarchy
- class \Drupal\price\NumberFormatterFactory implements NumberFormatterFactoryInterface
Expanded class hierarchy of NumberFormatterFactory
Deprecated
Use \Drupal\price\CurrencyFormatter instead.
1 string reference to 'NumberFormatterFactory'
1 service uses NumberFormatterFactory
File
- src/
NumberFormatterFactory.php, line 14
Namespace
Drupal\priceView source
class NumberFormatterFactory implements NumberFormatterFactoryInterface {
/**
* The currency formatter.
*
* @var \CommerceGuys\Intl\Formatter\CurrencyFormatterInterface
*/
protected $currencyFormatter;
/**
* Constructs a new NumberFormatterFactory object.
*
* @param \CommerceGuys\Intl\Formatter\CurrencyFormatterInterface $currency_formatter
* The currency formatter.
*/
public function __construct(CurrencyFormatterInterface $currency_formatter) {
$this->currencyFormatter = $currency_formatter;
}
/**
* {@inheritdoc}
*/
public function createInstance() {
return new LegacyNumberFormatter($this->currencyFormatter);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
NumberFormatterFactory:: |
protected | property | The currency formatter. | |
NumberFormatterFactory:: |
public | function |
Creates an instance of the number formatter for the current locale. Overrides NumberFormatterFactoryInterface:: |
|
NumberFormatterFactory:: |
public | function | Constructs a new NumberFormatterFactory object. |