*/ class TournamentEntryLister { public static function GetAllEntries(Tournament $tournament) { $tournamentId = $tournament->getIdentifier(); return TournamentEntryLister::GetEntries("WHERE tournamentId = $tournamentId"); } public static function GetAllEntriesFromCategory(Tournament $tournament, Category $category) { $tournamentId = $tournament->getIdentifier(); $categoryId = $category->getIdentifier(); return TournamentEntryLister::GetEntries("WHERE tournamentId = $tournamentId AND categoryId = $categoryId"); } public static function GetAllEntriesFromMember(Member $member) { $userId = $member->getIdentifier(); return TournamentEntryLister::GetEntries("WHERE userId = $userId"); } public static function GetAllEntriesFromMemberAndCategory(Member $member, Category $category) { $userId = $member->getIdentifier(); $categoryId = $category->getIdentifier(); $limitation = "WHERE categoryId = $categoryId AND userId = $userId"; return TournamentEntryLister::GetEntries($limitation); } private static function GetEntries($condition) { $sql = "SELECT entryId FROM tournamentsEntries $condition"; $result = MySQLDatabase::getInstance()->runRequest($sql); if ($result) { $result1 = array_map("mapIdentifierToTournamentEntry", $result); return $result1; } else { return array(); } } } ?>