public function getCachedValue($name, $checkWithActiveProfiles = true)
    {
        if ($this->cache->contains($name)) {
            $setting = $this->cache->fetch($name);
        } elseif ($this->has($name)) {
            $settingDocument = $this->get($name);
            $setting = [
                'value' => $settingDocument->getValue(),
                'profiles' => $settingDocument->getProfile(),
            ];
            $this->cache->save($name, $setting);
        } else {
            return null;
        }

        if ($checkWithActiveProfiles) {
            if (count(array_intersect($this->getActiveProfiles(), $setting['profiles']))) {
                return $setting['value'];
            }

            return null;
        }

        return $setting['value'];
    }
public function getCachedValue($name, $checkWithActiveProfiles = true)
    {
        if ($this->cache->contains($name)) {
            $setting = $this->cache->fetch($name);
        } elseif ($this->has($name)) {
            $settingDocument = $this->get($name);
            $setting = [
                'value' => $settingDocument->getValue(),
                'profiles' => $settingDocument->getProfile(),
            ];
            $this->cache->save($name, $setting);
        } else {
            return null;
        }

        if ($checkWithActiveProfiles) {
            if (count(array_intersect($this->getActiveProfiles(), $setting['profiles']))) {
                return $setting['value'];
            }

            return null;
        }

        return $setting['value'];
    }
public function getCachedValue ( $ name , $ checkWithActiveProfiles = true ) { if ( $ this -> cache -> contains ( $ name ) ) { $ setting = $ this -> cache -> fetch ( $ name ) ; } elseif ( $ this -> has ( $ name ) ) { $ settingDocument = $ this -> get ( $ name ) ; $ setting = [ 'value' => $ settingDocument -> getValue ( ) , 'profiles' => $ settingDocument -> getProfile ( ) , ] ; $ this -> cache -> save ( $ name , $ setting ) ; } else { return null ; } if ( $ checkWithActiveProfiles ) { if ( count ( array_intersect ( $ this -> getActiveProfiles ( ) , $ setting [ 'profiles' ] ) ) ) { return $ setting [ 'value' ] ; } return null ; } return $ setting [ 'value' ] ; }
Get setting value by checking also from cache engine.

@param string $name
@param bool   $checkWithActiveProfiles Checks if setting is in active profile.

@return mixed
Get setting value by checking also from cache engine .