diff --git a/library/Exceptions/SubdivisionCode/BqSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/BqSubdivisionCodeException.php new file mode 100644 index 00000000..2714773a --- /dev/null +++ b/library/Exceptions/SubdivisionCode/BqSubdivisionCodeException.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 Bonaire subdivision code. + * + * ISO 3166-1 alpha-2: BQ + */ +class BqSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Bonaire', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Bonaire', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/BqSubdivisionCode.php b/library/Rules/SubdivisionCode/BqSubdivisionCode.php new file mode 100644 index 00000000..318f906f --- /dev/null +++ b/library/Rules/SubdivisionCode/BqSubdivisionCode.php @@ -0,0 +1,32 @@ + + * + * 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 Bonaire subdivision code. + * + * ISO 3166-1 alpha-2: BQ + * + * @link http://www.geonames.org/BQ/administrative-division-bonaire.html + */ +class BqSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'BO', // Bonaire + 'SA', // Saba + 'SE', // Sint Eustatius + ); + + public $compareIdentical = true; +}