public function copyfrom($var,$func=NULL)
    {
        if (is_string($var)) {
            $var = Base::instance()->get($var);
        }
        if ($func) {
            $var = call_user_func($func, $var);
        }
        foreach ($var as $key=>$val) {
            if (
                array_key_exists($key, $this->fields)
                || array_key_exists($key, $this->extras)
            ) {
                $this->set($key,$val);
            }
        }
    }