diff --git a/library/Exceptions/SubdivisionCode/CiSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/CiSubdivisionCodeException.php new file mode 100644 index 00000000..493e8a7b --- /dev/null +++ b/library/Exceptions/SubdivisionCode/CiSubdivisionCodeException.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 Ivory Coast subdivision code. + * + * ISO 3166-1 alpha-2: CI + */ +class CiSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Ivory Coast', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Ivory Coast', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/CiSubdivisionCode.php b/library/Rules/SubdivisionCode/CiSubdivisionCode.php new file mode 100644 index 00000000..92c92347 --- /dev/null +++ b/library/Rules/SubdivisionCode/CiSubdivisionCode.php @@ -0,0 +1,48 @@ + + * + * 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 Ivory Coast subdivision code. + * + * ISO 3166-1 alpha-2: CI + * + * @link http://www.geonames.org/CI/administrative-division-ivory-coast.html + */ +class CiSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + '01', // Lagunes (Région des) + '02', // Haut-Sassandra (Région du) + '03', // Savanes (Région des) + '04', // Vallée du Bandama (Région de la) + '05', // Moyen-Comoé (Région du) + '06', // 18 Montagnes (Région des) + '07', // Lacs (Région des) + '08', // Zanzan (Région du) + '09', // Bas-Sassandra (Région du) + '10', // Denguélé (Région du) + '11', // Nzi-Comoé (Région) + '12', // Marahoué (Région de la) + '13', // Sud-Comoé (Région du) + '14', // Worodougou (Région du) + '15', // Sud-Bandama (Région du) + '16', // Agnébi (Région de l') + '17', // Bafing (Région du) + '18', // Fromager (Région du) + '19', // Moyen-Cavally (Région du) + ); + + public $compareIdentical = true; +}