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);
            }
        }
    }
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);
            }
        }
    }
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 ) ; } } }
Override parent method to accept custom property assigment
@param  mixed $var
@param  callable $func
@return void
Override parent method to accept custom property assigment