public function getStructure() { $cacheId = AuthManager::isAuthorized() ? 'a' : 'na' . '_structure'; $structure = PSCache::POSTS()->getFromCache($cacheId); if (!is_array($structure)) { PsProfiler::inst(__CLASS__)->start('Build structure'); $structure = $this->getStructureImpl()->toArray(); PsProfiler::inst(__CLASS__)->stop(); PSCache::POSTS()->saveToCache($structure, $cacheId); } return $structure; }
protected function cacheGroup() { return PSCache::POSTS(); }