diff --git a/library/Exceptions/SubdivisionCode/GmSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/GmSubdivisionCodeException.php new file mode 100644 index 00000000..d707a513 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/GmSubdivisionCodeException.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 Gambia subdivision code. + * + * ISO 3166-1 alpha-2: GM + */ +class GmSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Gambia', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Gambia', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/GmSubdivisionCode.php b/library/Rules/SubdivisionCode/GmSubdivisionCode.php new file mode 100644 index 00000000..941db36c --- /dev/null +++ b/library/Rules/SubdivisionCode/GmSubdivisionCode.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 Gambia subdivision code. + * + * ISO 3166-1 alpha-2: GM + * + * @link http://www.geonames.org/GM/administrative-division-gambia.html + */ +class GmSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'B', // Banjul + 'L', // Lower River + 'M', // Central River + 'N', // North Bank + 'U', // Upper River + 'W', // Western + ); + + public $compareIdentical = true; +}