public static function getAllChallengeWinners() { Challenge::getAllChallenges(); if (!self::$allFetched) { $items = query(__CLASS__)->sortDesc('time')->selectMultiple(); self::$cache = array(); foreach ($items as $item) { if (!$item->getChallenge()) { continue; } self::$cache[$item->id] = $item; } self::$allFetched = true; } return self::$cache; }