public function saveConfigurationModel($model, $validate = true, $apply = true)
    {
        if (!$model) {
            return false;
        }
        if ($validate && !$model->validate()) {
            return false;
        }
        if ($this->modelClass) {
            //If modelClass is using
            $modelClass = $this->modelClass;
            //Check object and save
            if (
                ($model instanceof $modelClass) &&
                $this->_keyStorage->set($this->getKey(), $model)
            ) {
                //Apply new configuration
                if ($apply) {
                    $this->_configuration = $model;
                    $this->configure();
                }
                return true;
            } else {
                return false;
            }
        } else {
            return $this->saveConfigurationArray($model->getAttributes(), $apply);
        }
    }
public function saveConfigurationModel($model, $validate = true, $apply = true)
    {
        if (!$model) {
            return false;
        }
        if ($validate && !$model->validate()) {
            return false;
        }
        if ($this->modelClass) {
            //If modelClass is using
            $modelClass = $this->modelClass;
            //Check object and save
            if (
                ($model instanceof $modelClass) &&
                $this->_keyStorage->set($this->getKey(), $model)
            ) {
                //Apply new configuration
                if ($apply) {
                    $this->_configuration = $model;
                    $this->configure();
                }
                return true;
            } else {
                return false;
            }
        } else {
            return $this->saveConfigurationArray($model->getAttributes(), $apply);
        }
    }
public function saveConfigurationModel ( $ model , $ validate = true , $ apply = true ) { if ( ! $ model ) { return false ; } if ( $ validate && ! $ model -> validate ( ) ) { return false ; } if ( $ this -> modelClass ) { //If modelClass is using $ modelClass = $ this -> modelClass ; //Check object and save if ( ( $ model instanceof $ modelClass ) && $ this -> _keyStorage -> set ( $ this -> getKey ( ) , $ model ) ) { //Apply new configuration if ( $ apply ) { $ this -> _configuration = $ model ; $ this -> configure ( ) ; } return true ; } else { return false ; } } else { return $ this -> saveConfigurationArray ( $ model -> getAttributes ( ) , $ apply ) ; } }
Saves configuration model. Performs validation if needed.

@param \yii\base\Model $model
@param bool $validate
@param bool $apply
@return bool
Saves configuration model . Performs validation if needed .