public function initCache(Cache $cache, $enableCache = false)
    {
        $this->cache          = $cache;
        $this->isCacheEnabled = $enableCache;

        if ($enableCache) {
            $this->cache->enable();
        } else {
            $this->cache->disable();
        }

        return $this;
    }
public function initCache(Cache $cache, $enableCache = false)
    {
        $this->cache          = $cache;
        $this->isCacheEnabled = $enableCache;

        if ($enableCache) {
            $this->cache->enable();
        } else {
            $this->cache->disable();
        }

        return $this;
    }
public function initCache ( Cache $ cache , $ enableCache = false ) { $ this -> cache = $ cache ; $ this -> isCacheEnabled = $ enableCache ; if ( $ enableCache ) { $ this -> cache -> enable ( ) ; } else { $ this -> cache -> disable ( ) ; } return $ this ; }
Set cache instance & enable cache if it is specified.

@param  Cache $cache
@param  bool  $enableCache
@return self
Set cache instance & enable cache if it is specified .