/** * @param string $uri * @param string $title * @param string $shortUri * @return CacheItem */ public function addCacheItem($uri, $title, $shortUri = '') { if ($this->cacheItemExists($uri)) { return $this->getCacheItem($uri); } $cacheItem = new CacheItem(); // Expire in 1 hour. $cacheItem->setExpireTime(time() + 60 * 60); $cacheItem->setTitle($title); $cacheItem->setShortUri($shortUri); $this->items[$uri] = $cacheItem; return $cacheItem; }