diff --git a/library/Exceptions/SubdivisionCode/VcSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/VcSubdivisionCodeException.php new file mode 100644 index 00000000..830025c0 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/VcSubdivisionCodeException.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 Saint Vincent and the Grenadines subdivision code. + * + * ISO 3166-1 alpha-2: VC + */ +class VcSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Saint Vincent and the Grenadines', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Saint Vincent and the Grenadines', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/VcSubdivisionCode.php b/library/Rules/SubdivisionCode/VcSubdivisionCode.php new file mode 100644 index 00000000..85412906 --- /dev/null +++ b/library/Rules/SubdivisionCode/VcSubdivisionCode.php @@ -0,0 +1,35 @@ + + * + * 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 Saint Vincent and the Grenadines subdivision code. + * + * ISO 3166-1 alpha-2: VC + * + * @link http://www.geonames.org/VC/administrative-division-saint-vincent-and-the-grenadines.html + */ +class VcSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + '01', // Charlotte + '02', // Saint Andrew + '03', // Saint David + '04', // Saint George + '05', // Saint Patrick + '06', // Grenadines + ); + + public $compareIdentical = true; +}