public function PriceModified::__construct in Price 3.x
Same name and namespace in other branches
- 8 src/PriceModified.php \Drupal\price\PriceModified::__construct()
- 3.0.x src/PriceModified.php \Drupal\price\PriceModified::__construct()
Constructs a new PriceModified object.
Parameters
string $number: The number.
string $currency_code: The currency code.
string $modifier: The modifier.
File
- src/
PriceModified.php, line 43
Class
- PriceModified
- Provides a value object for monetary values.
Namespace
Drupal\priceCode
public function __construct($number, $currency_code, $modifier) {
Calculator::assertNumberFormat($number);
$this
->assertCurrencyCodeFormat($currency_code);
$this->number = (string) $number;
$this->currencyCode = strtoupper($currency_code);
$this->modifier = $modifier;
}