Пример #1
0
 /**
  */
 protected function getCacheModel()
 {
     $cache = new TSqlMapCacheModel();
     //	$cache->setFlushInterval(5*60);
     $cache->setImplementation('LRU');
     $cache->initialize();
     return $cache;
 }
Пример #2
0
 /**
  * Adds a named cache.
  * @param TSqlMapCacheModel the cache to add.
  * @throws TSqlMapConfigurationException
  */
 public function addCacheModel(TSqlMapCacheModel $cacheModel)
 {
     if ($this->_cacheModels->contains($cacheModel->getID())) {
         throw new TSqlMapConfigurationException('sqlmap_cache_model_already_exists', $cacheModel->getID());
     } else {
         $this->_cacheModels->add($cacheModel->getID(), $cacheModel);
     }
 }