<?php

class Listing {
	public $listing_id;
	public $listing_type;
	public $listing_date;
	public $listing_agent_id;
	public $listing_condo_id;
	public $listing_district;
	public $listing_tenure_cat;
	public $listing_price;
	public $listing_psf;
	public $listing_yield;
	public $listing_unitarea;
	public $listing_sqfr_range;
	public $listing_unitbr;
	public $listing_geolat;
	public $listing_geolon;
	public $listing_description;
	public $listing_agency;
	public $listing_photo_count;
	public $listing_source;
	
	public $active;
	
	function __construct($params = null){
		if($params!=null) { 
			if(is_array($params)) {
				$this->set_listing_parameters($params);
			}
		}
	}
	
	function set_listing_parameters($params) {
		if(isset($params['listing_id'])){
			$this->listing_id = $params['listing_id'];
		}
		if(isset($params['listing_type'])){
			$this->listing_type = $params['listing_type'];
		}
		if(isset($params['listing_date'])){
			$this->listing_date = $params['listing_date'];
		}
		if(isset($params['listing_agent_id'])){
			$this->listing_agent_id = $params['listing_agent_id'];
		}
		if(isset($params['condo_id'])){
			$this->listing_condo_id = $params['condo_id'];
		}
		if(isset($params['district'])){
			$this->listing_district = $params['district'];
		}
		if(isset($params['listing_tenure_cat'])){
			$this->listing_tenure_cat = $params['listing_tenure_cat'];
		}
		if(isset($params['price'])){
			$this->listing_price = $params['price'];
		}
		if(isset($params['psf'])){
			$this->listing_psf = $params['psf'];
		}
		if(isset($params['yield'])){
			$this->listing_yield = $params['yield'];
		}
		if(isset($params['unitarea'])){
			$this->listing_unitarea = $params['unitarea'];
		}
		if(isset($params['sqfr_range'])){
			$this->listing_sqfr_range = $params['sqfr_range'];
		}
		if(isset($params['unitbr'])){
			$this->listing_unitbr = $params['unitbr'];
		}
		if(isset($params['geolat'])){
			$this->listing_geolat = $params['geolat'];
		}
		if(isset($params['geolon'])){
			$this->listing_geolon = $params['geolon'];
		}
		if(isset($params['description'])){
			$this->listing_description = $params['description'];
		}
		if(isset($params['listing_agency'])){
			$this->listing_agency = $params['listing_agency'];
		}
		if(isset($params['photo_count'])){
			$this->listing_photo_count = $params['photo_count'];
		}
		if(isset($params['source'])){
			$this->listing_source = $params['source'];
		}
		
		if(isset($params['active'])){
			$this->active = $params['active'];
		}
	}
	
}