Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Currency.php

function Currency::__construct

Parameters

array<string,mixed>|null $options:

string[]|null $groups:

Overrides Constraint::__construct

File

vendor/symfony/validator/Constraints/Currency.php, line 41

Class

Currency
Validates that a value is a valid 3-letter ISO 4217 currency name.

Namespace

Symfony\Component\Validator\Constraints

Code

public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null) {
    if (!class_exists(Currencies::class)) {
        throw new LogicException('The Intl component is required to use the Currency constraint. Try running "composer require symfony/intl".');
    }
    parent::__construct($options, $groups, $payload);
    $this->message = $message ?? $this->message;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal