Doctrine\Common\Cache\ChainCache::doFetch PHP Method

doFetch() protected method

{@inheritDoc}
protected doFetch ( $id )
    protected function doFetch($id)
    {
        foreach ($this->cacheProviders as $key => $cacheProvider) {
            if ($cacheProvider->doContains($id)) {
                $value = $cacheProvider->doFetch($id);
                // We populate all the previous cache layers (that are assumed to be faster)
                for ($subKey = $key - 1; $subKey >= 0; $subKey--) {
                    $this->cacheProviders[$subKey]->doSave($id, $value);
                }
                return $value;
            }
        }
        return false;
    }