diff --git a/library/Exceptions/SubdivisionCode/MlSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/MlSubdivisionCodeException.php new file mode 100644 index 00000000..59f7854a --- /dev/null +++ b/library/Exceptions/SubdivisionCode/MlSubdivisionCodeException.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 Mali subdivision code. + * + * ISO 3166-1 alpha-2: ML + */ +class MlSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Mali', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Mali', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/MlSubdivisionCode.php b/library/Rules/SubdivisionCode/MlSubdivisionCode.php new file mode 100644 index 00000000..ac06d4c2 --- /dev/null +++ b/library/Rules/SubdivisionCode/MlSubdivisionCode.php @@ -0,0 +1,38 @@ + + * + * 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 Mali subdivision code. + * + * ISO 3166-1 alpha-2: ML + * + * @link http://www.geonames.org/ML/administrative-division-mali.html + */ +class MlSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + '1', // Kayes + '2', // Koulikoro + '3', // Sikasso + '4', // Segou + '5', // Mopti + '6', // Tombouctou + '7', // Gao + '8', // Kidal + 'BKO', // Bamako Capital District + ); + + public $compareIdentical = true; +}