<?php

/**
* MILESTONE RANKING
*/
class milestone_ranking
{
    private $msr_id;
    private $msr_season;
    private $msr_date;
    private $msr_rankings;


    public function set_msr_data_by_id($_msr_id) {
        global $sql;
        $msr_assoc_array = $sql->assoc_array("select * from milestone_ranking where msr_id = " . $_msr_id);
        $msr_array = $msr_assoc_array[0];
        //alapadatok
        foreach ($msr_array as $field => $value) {
            $function_name = "set_" . $field;
            $this->$function_name($value);
        }
    }

    public static function create_msr($_date, $_rankings, $_season = 'null')
    {
        global $sql;
        return $sql->insert_into('milestone_ranking', array(
            'msr_date' => $_date,
            'msr_rankings' => $_rankings,
            'msr_season' => $_season,
        ));
    }

    /**
     * @return mixed
     */
    public function get_msr_id()
    {
        return $this->msr_id;
    }

    /**
     * @param mixed $msr_id
     *
     * @return self
     */
    public function set_msr_id($msr_id)
    {
        $this->msr_id = $msr_id;

        return $this;
    }

    /**
     * @return mixed
     */
    public function get_msr_season()
    {
        return $this->msr_season;
    }

    /**
     * @param mixed $msr_season
     *
     * @return self
     */
    public function set_msr_season($msr_season)
    {
        $this->msr_season = $msr_season;

        return $this;
    }

    /**
     * @return mixed
     */
    public function get_msr_date()
    {
        return $this->msr_date;
    }

    /**
     * @param mixed $msr_date
     *
     * @return self
     */
    public function set_msr_date($msr_date)
    {
        $this->msr_date = $msr_date;

        return $this;
    }

    /**
     * @return mixed
     */
    public function get_msr_rankings()
    {
        return $this->msr_rankings;
    }

    /**
     * @param mixed $msr_rankings
     *
     * @return self
     */
    public function set_msr_rankings($msr_rankings)
    {
        $this->msr_rankings = $msr_rankings;

        return $this;
    }
}


?>
