oxcountry.php

Go to the documentation of this file.
00001 <?php
00002 
00003 
00006 class oxCountry extends oxI18n
00007 {
00013     protected $_sClassName = 'oxcountry';
00014 
00020     protected $_aStates = null;
00021 
00025     public function __construct()
00026     {
00027         parent::__construct();
00028         $this->init( 'oxcountry' );
00029     }
00030 
00036     public function isForeignCountry()
00037     {
00038         return !in_array($this->getId(), $this->getConfig()->getConfigParam( 'aHomeCountry' ));
00039     }
00040 
00046     public function isInEU()
00047     {
00048         return (bool) ($this->oxcountry__oxvatstatus->value == 1);
00049     }
00050 
00056     public function getStates()
00057     {
00058         if (!is_null($this->_aStates))
00059             return $this->_aStates;
00060 
00061         $sCountryId = $this->getId();
00062         $sQ = "select * from oxstates where oxcountryid = '$sCountryId' ";
00063         $this->_aStates = oxNew("oxlist");
00064         $this->_aStates->init("oxstate");
00065         $this->_aStates->selectString($sQ);
00066 
00067         return $this->_aStates;
00068     }
00069 }