You are here

class CurrencyConstraint in Price 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/Validation/Constraint/CurrencyConstraint.php \Drupal\price\Plugin\Validation\Constraint\CurrencyConstraint
  2. 3.x src/Plugin/Validation/Constraint/CurrencyConstraint.php \Drupal\price\Plugin\Validation\Constraint\CurrencyConstraint
  3. 2.x src/Plugin/Validation/Constraint/CurrencyConstraint.php \Drupal\price\Plugin\Validation\Constraint\CurrencyConstraint
  4. 3.0.x src/Plugin/Validation/Constraint/CurrencyConstraint.php \Drupal\price\Plugin\Validation\Constraint\CurrencyConstraint

Currency constraint.

Plugin annotation


@Constraint(
  id = "PriceCurrency",
  label = @Translation("Currency", context = "Validation"),
  type = { "price_price" }
)

Hierarchy

  • class \Drupal\price\Plugin\Validation\Constraint\CurrencyConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of CurrencyConstraint

File

src/Plugin/Validation/Constraint/CurrencyConstraint.php, line 16

Namespace

Drupal\price\Plugin\Validation\Constraint
View source
class CurrencyConstraint extends Constraint {

  /**
   * The array of available currencies.
   *
   * @var array
   */
  public $availableCurrencies = [];

  /**
   * The default violation message.
   *
   * @var string
   */
  public $invalidMessage = 'The currency %value is not valid.';

  /**
   * The "not available" message.
   *
   * @var string
   */
  public $notAvailableMessage = 'The currency %value is not available.';

}

Members

Namesort descending Modifiers Type Description Overrides
CurrencyConstraint::$availableCurrencies public property The array of available currencies.
CurrencyConstraint::$invalidMessage public property The default violation message.
CurrencyConstraint::$notAvailableMessage public property The "not available" message.