Application\Cache\Manager::load PHP Метод

load() публичный Метод

Get cache data. If data not exists, generate data and save to cache
public load ( $key, $closure, $lifetime = 60 )
    public function load($key, $closure, $lifetime = 60)
    {
        if (is_array($key)) {
            $key = $this->key($key);
        }
        if ($lifetime == 0) {
            return $closure();
        }
        $data = $this->cache->get($key, $lifetime);
        if (!$data) {
            $data = $closure();
            $this->cache->save($key, $data, $lifetime);
        }
        return $data;
    }