diff options
Diffstat (limited to 'public/catalog/model/localisation/country.php')
-rw-r--r-- | public/catalog/model/localisation/country.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/public/catalog/model/localisation/country.php b/public/catalog/model/localisation/country.php new file mode 100644 index 0000000..10d29be --- /dev/null +++ b/public/catalog/model/localisation/country.php @@ -0,0 +1,22 @@ +<?php +class ModelLocalisationCountry extends Model { + public function getCountry($country_id) { + $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country WHERE country_id = '" . (int)$country_id . "' AND status = '1'"); + + return $query->row; + } + + public function getCountries() { + $country_data = $this->cache->get('country.catalog'); + + if (!$country_data) { + $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country WHERE status = '1' ORDER BY name ASC"); + + $country_data = $query->rows; + + $this->cache->set('country.catalog', $country_data); + } + + return $country_data; + } +}
\ No newline at end of file |