interface PostalCodeValidationInterface in Postal Code 8
Interface ValidatorServiceInterface. Provide interface with additional methods for validations of postal code field.
Hierarchy
- interface \Drupal\postal_code\PostalCodeValidationInterface
Expanded class hierarchy of PostalCodeValidationInterface
All classes that implement PostalCodeValidationInterface
2 files declare their use of PostalCodeValidationInterface
- PostalCodeSettingsForm.php in src/
Form/ PostalCodeSettingsForm.php - PostalCodeWidget.php in src/
Plugin/ Field/ FieldWidget/ PostalCodeWidget.php
File
- src/
PostalCodeValidationInterface.php, line 10
Namespace
Drupal\postal_codeView source
interface PostalCodeValidationInterface {
/**
* Actual validation function.
*
* @return array of RegExp patterns for validation.
*/
public function getValidationPatterns();
/**
* Custom function defining regexes corresponding to different countries.
*
* @param string $country_code
* Short country code.
* @param string $value
* Value to be validated.
*
* @return array
* Array of errors.
*/
public function validate($country_code, $value);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PostalCodeValidationInterface:: |
public | function | Actual validation function. | 1 |
PostalCodeValidationInterface:: |
public | function | Custom function defining regexes corresponding to different countries. | 1 |