<?php
class Shop_Postalcode extends MY_Model
{
	const DB_TABLE = 'shop_postalcodes';
    const DB_TABLE_PK = 'postalcode_id';

    function LoadByCode($postalcode)
	{
		$postalcode = str_replace(array(" ", "-"), "", $postalcode);

		$query = $this->db->query("SELECT * FROM shop_postalcodes WHERE postalcode=?", array($postalcode));

		foreach($query->result() as $row)
		{
			return $this->populate($row);
		}

		return false;
	}
}
