<?php
class ModelLocalisationZone extends Model {
	public function getZone($zone_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone WHERE zone_id = '" . (int)$zone_id . "'");

		return $query->row;
	}

	/**
	 *　日本語版変更点　都道府県のソート順をzone_idに変更
	 */
	public function getZonesByCountryId($country_id) {
		$zone_data = $this->cache->get('zone.' . $country_id);

		if (!$zone_data) {

			$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone WHERE country_id = '" . (int)$country_id . "' ORDER BY zone_id");

			$zone_data = $query->rows;

			$this->cache->set('zone.' . $country_id, $zone_data);
		}

		return $zone_data;
	}
}
?>