public static function generate(array $params) { $perma = array_shift($params); $bracket = Api\Bracket::getBracketByPerma($perma); if ($bracket) { // TODO - get full voting stats $entrantStats = Api\Stats::getEntrantPerformanceStats($bracket); Lib\Display::addKey('page', 'stats'); Lib\Display::addKey('title', 'Stats for ' . $bracket->name . DEFAULT_TITLE_SUFFIX); Lib\Display::renderAndAddKey('content', 'stats', ['entrants' => $entrantStats, 'bracket' => $bracket]); } }
/** * Advances the bracket to the next tier/group */ public function advance() { // Lock the bracket $cacheKey = $this->_lockedCacheKey(); Lib\Cache::set($cacheKey, true, CACHE_MEDIUM); switch ($this->state) { case BS_ELIMINATIONS: $this->_advanceEliminations(); break; case BS_VOTING: $this->_advanceBracket(); Stats::getEntrantPerformanceStats($this, true); break; } // Force update various cached things $this->getResults(true); Round::getCurrentRounds($this->id, true); // Unlock. Keep this on a short cache since it'll default back to false anyways Lib\Cache::set($cacheKey, false, CACHE_SHORT); }