Elgg\ViewsService::configureFromCache PHP Method

configureFromCache() public method

Configure locations from the cache
public configureFromCache ( SystemCache $cache ) : boolean
$cache Elgg\Cache\SystemCache The system cache
return boolean
    public function configureFromCache(SystemCache $cache)
    {
        $data = $cache->load('view_locations');
        if (!is_string($data)) {
            return false;
        }
        // format changed, check version
        $data = unserialize($data);
        if (empty($data['version']) || $data['version'] !== '2.0') {
            return false;
        }
        $this->locations = $data['locations'];
        $this->cache = $cache;
        return true;
    }