country.php (626B)
1 <?php 2 class ModelLocalisationCountry extends Model { 3 public function getCountry($country_id) { 4 $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country WHERE country_id = '" . (int)$country_id . "' AND status = '1'"); 5 6 return $query->row; 7 } 8 9 public function getCountries() { 10 $country_data = $this->cache->get('country.catalog'); 11 12 if (!$country_data) { 13 $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country WHERE status = '1' ORDER BY name ASC"); 14 15 $country_data = $query->rows; 16 17 $this->cache->set('country.catalog', $country_data); 18 } 19 20 return $country_data; 21 } 22 }