<?php

/*
    AUTHORITY CLASS
*/

class authority {
    private $a_id;
    private $a_name;
    private $a_title;

    public function set_a_id($_id) {
        $this->a_id = $_id;
    }

    public function get_a_id() {
        return $this->a_id;
    }

    public function set_a_name($_name) {
        $this->a_name = $_name;
    }

    public function get_a_name() {
        return $this->a_name;
    }

    public function set_a_title($_title) {
        $this->a_title = $_title;
    }

    public function get_a_title() {
        return $this->a_title;
    }

    public function set_a_data_by_id($_id) {
        global $sql;
        $a_query = "SELECT * FROM authority WHERE a_id = " . $_id . ";";
        $a_assoc_array = $sql->assoc_array($a_query);
        foreach ($a_assoc_array[0] as $field => $value) {
            $function_name = "set_" . $field;
            $this->$function_name($value); //alapadatok beállítása
        }
    }

}

?>
