public function getConfiguration()
    {
        if (!$this->_configuration) {

            //If model is using
            if ($this->modelClass) {

                $this->_configuration = $this->_keyStorage->get($this->getKey()) ?: [];
                $modelClass = $this->modelClass;
                if (!$this->_configuration || !($this->_configuration instanceof $modelClass)) {
                    //Initialize new model. Default values must be set in model (init method)
                    $this->_configuration = Yii::createObject($modelClass, $this->modelConfig);
                }

                //Default values from 'attributes'
                if (is_array($this->attributes)) {
                    foreach ($this->attributes as $key => $default) {
                        if ($this->_configuration->{$key} === null) {
                            $this->_configuration->{$key} = $default;
                        }
                    }
                }

            } else {

                //Array configuration
                $dbConfig = $this->_keyStorage->get($this->getKey()) ?: [];

                if (is_array($this->attributes)) {
                    //Needs to filter
                    $config = [];
                    foreach ($this->attributes as $key => $default) {
                        $config[$key] = (isset($dbConfig[$key]) && $dbConfig[$key] !== null) ? $dbConfig[$key] : $default;
                    }
                    $this->_configuration = $config;
                } else {
                    $this->_configuration = $dbConfig;
                }

            }
        }
        return $this->_configuration;
    }
public function getConfiguration()
    {
        if (!$this->_configuration) {

            //If model is using
            if ($this->modelClass) {

                $this->_configuration = $this->_keyStorage->get($this->getKey()) ?: [];
                $modelClass = $this->modelClass;
                if (!$this->_configuration || !($this->_configuration instanceof $modelClass)) {
                    //Initialize new model. Default values must be set in model (init method)
                    $this->_configuration = Yii::createObject($modelClass, $this->modelConfig);
                }

                //Default values from 'attributes'
                if (is_array($this->attributes)) {
                    foreach ($this->attributes as $key => $default) {
                        if ($this->_configuration->{$key} === null) {
                            $this->_configuration->{$key} = $default;
                        }
                    }
                }

            } else {

                //Array configuration
                $dbConfig = $this->_keyStorage->get($this->getKey()) ?: [];

                if (is_array($this->attributes)) {
                    //Needs to filter
                    $config = [];
                    foreach ($this->attributes as $key => $default) {
                        $config[$key] = (isset($dbConfig[$key]) && $dbConfig[$key] !== null) ? $dbConfig[$key] : $default;
                    }
                    $this->_configuration = $config;
                } else {
                    $this->_configuration = $dbConfig;
                }

            }
        }
        return $this->_configuration;
    }
public function getConfiguration ( ) { if ( ! $ this -> _configuration ) { //If model is using if ( $ this -> modelClass ) { $ this -> _configuration = $ this -> _keyStorage -> get ( $ this -> getKey ( ) ) ? : [ ] ; $ modelClass = $ this -> modelClass ; if ( ! $ this -> _configuration || ! ( $ this -> _configuration instanceof $ modelClass ) ) { //Initialize new model. Default values must be set in model (init method) $ this -> _configuration = Yii :: createObject ( $ modelClass , $ this -> modelConfig ) ; } //Default values from 'attributes' if ( is_array ( $ this -> attributes ) ) { foreach ( $ this -> attributes as $ key => $ default ) { if ( $ this -> _configuration -> { $ key } === null ) { $ this -> _configuration -> { $ key } = $ default ; } } } } else { //Array configuration $ dbConfig = $ this -> _keyStorage -> get ( $ this -> getKey ( ) ) ? : [ ] ; if ( is_array ( $ this -> attributes ) ) { //Needs to filter $ config = [ ] ; foreach ( $ this -> attributes as $ key => $ default ) { $ config [ $ key ] = ( isset ( $ dbConfig [ $ key ] ) && $ dbConfig [ $ key ] !== null ) ? $ dbConfig [ $ key ] : $ default ; } $ this -> _configuration = $ config ; } else { $ this -> _configuration = $ dbConfig ; } } } return $ this -> _configuration ; }
Returns owner config
@return mixed
Returns owner config