class CountryConstraint in Address 8
Country constraint.
Plugin annotation
@Constraint(
id = "Country",
label = @Translation("Country", context = "Validation"),
)
Hierarchy
- class \Drupal\address\Plugin\Validation\Constraint\CountryConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of CountryConstraint
1 file declares its use of CountryConstraint
- CountryConstraintValidatorTest.php in tests/
src/ Unit/ Plugin/ Validation/ Constraint/ CountryConstraintValidatorTest.php
File
- src/
Plugin/ Validation/ Constraint/ CountryConstraint.php, line 15
Namespace
Drupal\address\Plugin\Validation\ConstraintView source
class CountryConstraint extends Constraint {
/**
* List of available countries.
*
* @var string[]
*/
public $availableCountries = [];
/**
* Validation message if a country is invalid.
*
* @var string
*/
public $invalidMessage = 'The country %value is not valid.';
/**
* Validation message if a country is not available.
*
* @var string
*/
public $notAvailableMessage = 'The country %value is not available.';
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CountryConstraint:: |
public | property | List of available countries. | |
CountryConstraint:: |
public | property | Validation message if a country is invalid. | |
CountryConstraint:: |
public | property | Validation message if a country is not available. |