protected function prepareModel(Model $model)
    {
        if (is_callable($this->prepareModel)) {
            call_user_func($this->prepareModel, $model);
        } else {
            foreach ($model->attributes() as $attribute) {
                $value = Yii::$app->settings->get($this->getSection($model), $attribute);

                if (!is_null($value)) {
                    $model->{$attribute} = $value;
                }
            }
        }
    }
protected function prepareModel(Model $model)
    {
        if (is_callable($this->prepareModel)) {
            call_user_func($this->prepareModel, $model);
        } else {
            foreach ($model->attributes() as $attribute) {
                $value = Yii::$app->settings->get($this->getSection($model), $attribute);

                if (!is_null($value)) {
                    $model->{$attribute} = $value;
                }
            }
        }
    }
protected function prepareModel ( Model $ model ) { if ( is_callable ( $ this -> prepareModel ) ) { call_user_func ( $ this -> prepareModel , $ model ) ; } else { foreach ( $ model -> attributes ( ) as $ attribute ) { $ value = Yii :: $ app -> settings -> get ( $ this -> getSection ( $ model ) , $ attribute ) ; if ( ! is_null ( $ value ) ) { $ model -> { $ attribute } = $ value ; } } } }
Prepares the model which will be used to validate the attributes.

@param Model $model
Prepares the model which will be used to validate the attributes .