diff --git a/library/Exceptions/SubdivisionCode/FjSubdivisionCodeException.php b/library/Exceptions/SubdivisionCode/FjSubdivisionCodeException.php new file mode 100644 index 00000000..2fe77b5c --- /dev/null +++ b/library/Exceptions/SubdivisionCode/FjSubdivisionCodeException.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 Fiji subdivision code. + * + * ISO 3166-1 alpha-2: FJ + */ +class FjSubdivisionCodeException extends SubdivisionCodeException +{ + public static $defaultTemplates = array( + self::MODE_DEFAULT => array( + self::STANDARD => '{{name}} must be a subdivision code of Fiji', + ), + self::MODE_NEGATIVE => array( + self::STANDARD => '{{name}} must not be a subdivision code of Fiji', + ), + ); +} diff --git a/library/Rules/SubdivisionCode/FjSubdivisionCode.php b/library/Rules/SubdivisionCode/FjSubdivisionCode.php new file mode 100644 index 00000000..ed02cfdb --- /dev/null +++ b/library/Rules/SubdivisionCode/FjSubdivisionCode.php @@ -0,0 +1,34 @@ + + * + * 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 Fiji subdivision code. + * + * ISO 3166-1 alpha-2: FJ + * + * @link http://www.geonames.org/FJ/administrative-division-fiji.html + */ +class FjSubdivisionCode extends AbstractSearcher +{ + public $haystack = array( + 'C', // Central Division + 'E', // Eastern Division + 'N', // Northern Division + 'R', // Rotuma + 'W', // Western Division + ); + + public $compareIdentical = true; +}