You are here

interface PostalCodeValidationInterface in Postal Code 8

Interface ValidatorServiceInterface. Provide interface with additional methods for validations of postal code field.

Hierarchy

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_code
View 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

Namesort descending Modifiers Type Description Overrides
PostalCodeValidationInterface::getValidationPatterns public function Actual validation function. 1
PostalCodeValidationInterface::validate public function Custom function defining regexes corresponding to different countries. 1