Source for file Country.php
Documentation is available at Country.php
* $Id: Country.php 1080 2007-02-10 18:17:08Z romanb $
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
* Doctrine_Validator_Country
* @category Object Relational Mapping
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.com
* @version $Revision: 1080 $
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
private static $countries =
array(
'ae' =>
'United Arab Emirates',
'ag' =>
'Antigua and Barbuda',
'an' =>
'Netherlands Antilles',
'as' =>
'American Samoa',
'ba' =>
'Bosnia Hercegovina',
'bn' =>
'Brunei Darussalam',
'by' =>
'Belarus (Byelorussia)',
'cd' =>
'Congo, The Democratic Republic of the',
'cf' =>
'Central African Republic',
'cs' =>
'Czechoslovakia',
'cx' =>
'Christmas Island',
'cz' =>
'Czech Republic',
'do' =>
'Dominican Republic',
'eh' =>
'Western Sahara',
'fk' =>
'Falkland Islands',
'fx' =>
'France, Metropolitan FX',
'gb' =>
'United Kingdom (Great Britain)',
'gq' =>
'Equatorial Guinea',
'gs' =>
'South Georgia and the South Sandwich Islands',
'hm' =>
'Heard and McDonald Islands',
'io' =>
'British Indian Ocean Territory',
'kn' =>
'Saint Kitts and Nevis',
'ky' =>
'Cayman Islands',
'md' =>
'Moldova Republic',
'mh' =>
'Marshall Islands',
'mk' =>
'Macedonia, The Former Yugoslav Republic of',
'mp' =>
'Northern Mariana Islands',
'nf' =>
'Norfolk Island',
'pf' =>
'French Polynesia',
'pg' =>
'Papua New Guinea',
'pm' =>
'St. Pierre and Miquelon',
'sb' =>
'Solomon Islands',
'sj' =>
'Svalbard and Jan Mayen Islands',
'sk' =>
'Slovakia (Slovak Republic)',
'st' =>
'Sao Tome and Principe',
'tc' =>
'Turks and Caicos Islands',
'tf' =>
'French Southern Territories',
'tt' =>
'Trinidad, Tobago',
'uk' =>
'United Kingdom',
'um' =>
'United States Minor Islands',
'us' =>
'United States of America',
'vc' =>
'Saint Vincent, Grenadines',
'vg' =>
'Virgin Islands (British)',
'vi' =>
'Virgin Islands (USA)',
'wf' =>
'Wallis and Futuna Islands',
* @param Doctrine_Record $record
public function validate(Doctrine_Record $record, $key, $value, $args)
$value =
strtolower($value);
return isset
(self::$countries[$value]);