<?php

# EDZÉS TÍPUS OSZTÁLY


class training_type {
	private $trt_id;
	private $trt_name;
	private $trt_deleted;

	public function set_trt_id($_id) {
		$this->trt_id = $_id;
	}

	public function set_trt_name($_name) {
		$this->trt_name = $_name;
	}

	public function set_trt_deleted($_deleted) {
		$this->trt_deleted = $_deleted;
	}

	public function get_trt_id() {
		return $this->trt_id;
	}

	public function get_trt_name() {
		return $this->trt_name;
	}

	public function get_trt_deleted() {
		return $this->trt_deleted;
	}

	public static function create_training_type($_trt_value_array) {
		global $sql;
		return $sql->insert_into('training_type', $_trt_value_array);
	}

	public function set_trt_data_by_id($_id) {
        global $sql;
        $trt_data_assoc_array = $sql->assoc_array("select * from training_type where trt_id = " . $_id);
        $trt_data_array = $trt_data_assoc_array[0];
        foreach ($trt_data_array as $field => $value) {
            $function_name = "set_" . $field;
            $this->$function_name($value); //alapadatok beállítása
        }

    }
}


?>
