public function saveAs($model)
    {
        if (is_string($model)) {
            $model = $this->app->normalizeClassName($model, 'Model');
            $model = $this->add($model);
        }
        $this->_save_as = $model;
        $res = $this->save();
        $this->_save_as = null;

        return $res;
    }
public function saveAs($model)
    {
        if (is_string($model)) {
            $model = $this->app->normalizeClassName($model, 'Model');
            $model = $this->add($model);
        }
        $this->_save_as = $model;
        $res = $this->save();
        $this->_save_as = null;

        return $res;
    }
public function saveAs ( $ model ) { if ( is_string ( $ model ) ) { $ model = $ this -> app -> normalizeClassName ( $ model , 'Model' ) ; $ model = $ this -> add ( $ model ) ; } $ this -> _save_as = $ model ; $ res = $ this -> save ( ) ; $ this -> _save_as = null ; return $ res ; }
Save model into database and try to load it back as a new model of specified class.
Instance of new class is returned.
Save model into database and try to load it back as a new model of specified class . Instance of new class is returned .