You are here

CurrencyCode.php in Currency 8.3

File

src/Plugin/Validation/Constraint/CurrencyCode.php
View source
<?php

namespace Drupal\currency\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraints\Regex;

/**
 * Currency code constraint.
 *
 * @Plugin(
 *   id = "CurrencyCode",
 *   label = @Translation("Currency code"),
 *   type = { "string" }
 * )
 */
class CurrencyCode extends Regex {

  /**
   * {@inheritdoc}
   */
  public $message = '%currency_code is not a valid ISO 4217 currency code.';

  /**
   * {@inheritdoc}
   */
  public $pattern = '/^[A-Z]{3}$/i';

}

Classes

Namesort descending Description
CurrencyCode Currency code constraint.