<?php

/**
* MILESTONE COMPETITION
*/
class milestone_camp
{
    private $msca_id;
    private $msca_date;
    private $msca_place;
    private $msca_month;


    public function set_msca_data_by_id($_msca_id) {
        global $sql;
        $cat_assoc_array = $sql->assoc_array("select * from milestone_camp where msca_id = " . $_msca_id);
        $cat_array = $cat_assoc_array[0];
        //alapadatok
        foreach ($cat_array as $field => $value) {
            $function_name = "set_" . $field;
            $this->$function_name($value);
        }
    }

    public static function create_msca($_date, $_place)
    {
        global $sql;
        return $sql->insert_into('milestone_camp', array(
            'msca_date' => $_date,
            'msca_place' => $_place,
        ));
    }


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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }
}


?>
