<?php

class setting_value {
	private $setv_id;
	private $setv_set_date;
	private $setv_setting_set_id; //id
	private $setv_setting; //obj
	private $setv_int;
	private $setv_varchar;
	private $setv_text;
	private $setv_date;


	public function set_setv_id($_item) {
		$this->setv_id = $_item;
	}

	public function set_setv_set_date($_item) {
		$this->setv_set_date = $_item;
	}

	public function set_setv_setting_set_id($_item) {
		$this->setv_setting_set_id = $_item;
	}

	public function set_setv_setting($_item) {
		$this->setv_setting = $_item;
	}

	public function set_setv_int($_item) {
		$this->setv_int = $_item;
	}

	public function set_setv_varchar($_item) {
		$this->setv_varchar = $_item;
	}

	public function set_setv_text($_item) {
		$this->setv_text = $_item;
	}

	public function set_setv_date($_item) {
		$this->setv_date = $_item;
	}

	public function get_setv_id() {
		return $this->setv_id;
	}

	public function get_setv_set_date() {
		return $this->setv_set_date;
	}

	public function get_setv_setting_set_id() {
		return $this->setv_setting_set_id;
	}

	public function get_setv_setting() {
		return $this->setv_setting;
	}

	public function get_setv_int() {
		return $this->setv_int;
	}

	public function get_setv_varchar() {
		return $this->setv_varchar;
	}

	public function get_setv_text() {
		return $this->setv_text;
	}

	public function get_setv_date() {
		return $this->setv_date;
	}

	public function set_setting_value_data_by_id($_id) {
		//SETTING ID ALAPJÁN KÉRI LE;
		//HA KELL, LEHET KÜLÖN FUNCTION-T ÍRNI HOGY ID ALAPJÁN KÉRJE
		global $sql;
		$set_data_assoc_array = $sql->assoc_array("select * from setting_value where setv_setting_set_id = " . $_id);
		$set_data_array = $set_data_assoc_array[0];
		foreach ($set_data_array as $field => $value) {
			$function_name = "set_" . $field;
			$this->$function_name($value); //alapadatok beállítása

			if ($field == 'setv_setting_set_id') {
				$new_set = new setting();
				$new_set->set_setting_data_by_id($value);
				$this->set_setv_setting($new_set);
			}
		}

	}

}


?>