/** * @param array $facets * @param string $treeKey * * @return array */ public function getTree(array $facets = array(), $treeKey = '') { $cacheTreeId = 'simpleTree-' . $treeKey; $cachedTree = $this->objectCache->getItem($cacheTreeId); if (is_array($cachedTree)) { return $cachedTree; } if ($treeKey === '') { return $this->generatePageTree($this->orderAndFilter($facets)); } $tree = $this->generatePageTree($this->orderAndFilter($facets)); $this->objectCache->setItem($cacheTreeId, $tree); return $tree; }
/** * Get current key, value or metadata. * * @return mixed */ public function current() { if ($this->mode == IteratorInterface::CURRENT_AS_SELF) { return $this; } $key = $this->key(); if ($this->mode == IteratorInterface::CURRENT_AS_VALUE) { return $this->storage->getItem($key); } elseif ($this->mode == IteratorInterface::CURRENT_AS_METADATA) { return $this->storage->getMetadata($key); } return $key; }