diff --git a/library/Exceptions/SubdivisionCode/AoSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/AoSubdivisionCodeException.php new file mode 100644 index 00000000..7dd969e3 --- /dev/null +++ b/library/Exceptions/SubdivisionCode/AoSubdivisionCodeException.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 Angola subdivision code. + * + * ISO 3166-1 alpha-2: AO + */ +class AoSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Angola', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Angola', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/AoSubdivisionCode.php b/library/Rules/SubdivisionCode/AoSubdivisionCode.php new file mode 100644 index 00000000..fcd91e6d --- /dev/null +++ b/library/Rules/SubdivisionCode/AoSubdivisionCode.php @@ -0,0 +1,47 @@ + + * + * 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 Angola subdivision code. + * + * ISO 3166-1 alpha-2: AO + * + * @link http://www.geonames.org/AO/administrative-division-angola.html + */ +class AoSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'BGO', // Bengo + 'BGU', // Benguela province + 'BIE', // Bie + 'CAB', // Cabinda + 'CCU', // Cuando-Cubango + 'CNN', // Cunene + 'CNO', // Cuanza Norte + 'CUS', // Cuanza Sul + 'HUA', // Huambo province + 'HUI', // Huila province + 'LNO', // Lunda Norte + 'LSU', // Lunda Sul + 'LUA', // Luanda + 'MAL', // Malange + 'MOX', // Moxico + 'NAM', // Namibe + 'UIG', // Uige + 'ZAI', // Zaire + ); + + public $compareIdentical = true; +}