/** * @group tags */ public function testGetIdsMatchingTag() { $this->setKeys(); $ids = $this->cache->getIdsMatchingTags(array('tag_a1', 'tag_a2')); sort($ids); $this->assertEquals(array('test_bbb'), $ids); }
/** * Returns the page item cache. * * @return array */ public function getPageItemCache() { $data = array(); if ($this->_cacheEnabled()) { foreach (self::$_cache->getIdsMatchingTags(array($this->_getCacheInternalId())) as $id) { if (preg_match('|' . self::CACHE_TAG_PREFIX . "(\\d+)_.*|", $id, $page)) { $data[$page[1]] = self::$_cache->load($this->_getCacheId($page[1])); } } } return $data; }
/** * Return an array of stored cache ids which match given tags * * In case of multiple tags, a logical AND is made between tags * * @param array $tags array of tags * @return array array of matching cache ids (string) */ public function getIdsMatchingTags($tags = array()) { $tags = $this->_tags($tags); return parent::getIdsMatchingTags($tags); }