예제 #1
0
 /**
  * Clear the page item cache.
  *
  * @param int $page_number
  * @return Paginator
  */
 public function clear_page_item_cache($page_number = null)
 {
     if (!$this->_cache_enabled()) {
         return $this;
     }
     if (null === $page_number) {
         foreach (self::$_cache->getIdsMatchingTags(array($this->_get_cache_internal_id())) as $id) {
             if (preg_match('|' . self::CACHE_TAG_PREFIX . "(\\d+)_.*|", $id, $page)) {
                 self::$_cache->remove($this->_get_cache_id($page[1]));
             }
         }
     } else {
         $clean_id = $this->_get_cache_id($page_number);
         self::$_cache->remove($clean_id);
     }
     return $this;
 }