Ejemplo n.º 1
0
 /**
  * Refreshes various generic caches. This is expensive; use sparingly
  */
 protected static function _refreshCaches(Api\Bracket $bracket = null)
 {
     Lib\Cache::setDisabled(true);
     // Refresh the main collections
     Api\Bracket::getAll();
     Api\Bracket::getUserOwnedBrackets(self::$_user);
     \Controller\Brackets::generate(['past']);
     \Controller\Brackets::generate([]);
     // Refresh a single bracket if specified
     if ($bracket) {
         Api\Bracket::getBracketByPerma($bracket->perma);
         Api\Round::getCurrentRounds($bracket->id);
         $bracket->getResults();
     }
     Lib\Cache::setDisabled(false);
 }