private function _getFastFillingPercentage($mode) { if ($mode == 'saving') { // mode saving if ($this->_fastBackendFillingPercentage === null) { $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage(); } else { $rand = rand(1, $this->_options['stats_update_factor']); if ($rand == 1) { // we force a refresh $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage(); } } } else { // mode loading // we compute the percentage only if it's not available in cache if ($this->_fastBackendFillingPercentage === null) { $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage(); } } return $this->_fastBackendFillingPercentage; }
/** * Clear all the cache values. * @return CacheableInterface */ public function clear() { $this->cache->clean(\Zend_Cache::CLEANING_MODE_ALL); return $this; }