private function set_object_variables($id, $per_page, $zero) {
        if (!$per_page || !is_numeric($per_page)) {
            \AsyncWeb\Text\Messages::getInstance()->warning(\AsyncWeb\System\Language::get("error_iterator_per_page_wrong"), false);
            $per_page = 10;
        }
        if ($this->typ == "old" || $this->typ == "jquery") {
            if (Iterator::$use_session) {
                if (\AsyncWeb\Storage\Session::get("ITER_${id}_ON")) {
                    // iterator uz existuje
                    $this->start_from = \AsyncWeb\Storage\Session::get("ITER_${id}_PAGE") * \AsyncWeb\Storage\Session::get("ITER_${id}_PER_PAGE");
                    // ak by sme dostali novu hodnotu per page, tak musime vypocitat na ktorej sme strane.
                    \AsyncWeb\Storage\Session::set("ITER_${id}_PAGE", floor($this->start_from / $per_page));
                    \AsyncWeb\Storage\Session::set("ITER_${id}_PER_PAGE", $per_page);
                    if (!$zero) $this->start_from++;
                    $this->end = $this->start_from + $per_page;
                    $this->per_page = $per_page;
                } else {
                    // musime vytvorit iterator
                    $this->start_from = 0;
                    if (!$zero) $this->start_from++;
                    $this->end = $per_page;
                    $this->per_page = $per_page;
                    \AsyncWeb\Storage\Session::set("ITER_${id}_PAGE", $this->start_from);
                    \AsyncWeb\Storage\Session::set("ITER_${id}_PER_PAGE", $per_page);
                    \AsyncWeb\Storage\Session::set("ITER_${id}_ON", true);
                }
                $this->page = \AsyncWeb\Storage\Session::get("ITER_" . $this->id . "_PAGE");
            } else {
                $this->start_from = $this->page * $per_page;
                if (!$zero) $this->start_from++;
                $this->end = $this->start_from + $per_page;
                $this->per_page = $per_page;
            }
        } elseif ($this->typ == "redir") {
            $this->start_from = $this->page * $per_page;
            if (!$zero) $this->start_from++;
            $this->end = $this->start_from + $per_page;
            $this->per_page = $per_page;
        }
    }