diff --git a/library/Exceptions/SubdivisionCode/AxSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/AxSubdivisionCodeException.php new file mode 100644 index 00000000..ec986c04 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/AxSubdivisionCodeException.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the "LICENSE.md" + * file that was distributed with this source code. + */ + +namespace Respect\Validation\Exceptions\SubdivisionCode; + +use Respect\Validation\Exceptions\SubdivisionCodeException; + +/** + * Exception class for Åland subdivision code. + * + * ISO 3166-1 alpha-2: AX + */ +class AxSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Åland', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Åland', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/AxSubdivisionCode.php b/library/Rules/SubdivisionCode/AxSubdivisionCode.php new file mode 100644 index 00000000..e7b31272 --- /dev/null +++ b/library/Rules/SubdivisionCode/AxSubdivisionCode.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the "LICENSE.md" + * file that was distributed with this source code. + */ + +namespace Respect\Validation\Rules\SubdivisionCode; + +use Respect\Validation\Rules\AbstractSearcher; + +/** + * Validator for Åland subdivision code. + * + * ISO 3166-1 alpha-2: AX + * + * @link http://www.geonames.org/AX/administrative-division-aland.html + */ +class AxSubdivisionCode extends AbstractSearcher +{ + public $haystack = array(null, ''); + + public $compareIdentical = true; +}