protected function getModel($key)
    {
        if (!array_key_exists($key, $this->models)) {
            list($namespace, $key) = $this->splitNamespaceAndKey($key);

            $this->models[$key] = Config::query()
                                        ->where(Config::FIELD_NAMESPACE, $namespace)
                                        ->where(Config::FIELD_KEY, $key)
                                        ->first();

            // Cache if data is found in database
            if ($this->models[$key] !== null) {
                $this->cache->forever($key, $this->models[$key]->value);
            }
        }

        return $this->models[$key];
    }
protected function getModel($key)
    {
        if (!array_key_exists($key, $this->models)) {
            list($namespace, $key) = $this->splitNamespaceAndKey($key);

            $this->models[$key] = Config::query()
                                        ->where(Config::FIELD_NAMESPACE, $namespace)
                                        ->where(Config::FIELD_KEY, $key)
                                        ->first();

            // Cache if data is found in database
            if ($this->models[$key] !== null) {
                $this->cache->forever($key, $this->models[$key]->value);
            }
        }

        return $this->models[$key];
    }
protected function getModel ( $ key ) { if ( ! array_key_exists ( $ key , $ this -> models ) ) { list ( $ namespace , $ key ) = $ this -> splitNamespaceAndKey ( $ key ) ; $ this -> models [ $ key ] = Config :: query ( ) -> where ( Config :: FIELD_NAMESPACE , $ namespace ) -> where ( Config :: FIELD_KEY , $ key ) -> first ( ) ; // Cache if data is found in database if ( $ this -> models [ $ key ] !== null ) { $ this -> cache -> forever ( $ key , $ this -> models [ $ key ] -> value ) ; } } return $ this -> models [ $ key ] ; }
Get config model by key

@param string $key config key

@return \ViKon\DbConfig\Model\Config|null return NULL if model was not found in database
Get config model by key