__construct()
__construct(\mysqli $db)
BetManager constructor.
Stores a mysqli connection to interface with the database
Parameters
\mysqli | $db |
Class BetManager This class contains various methods to manage bets.
getAllBetsForUserOnMatchday(\welwitschi\User $user, \cheetah\int $matchday) : \cheetah\array:
Retrieves all matches for a user on a specified matchday
\welwitschi\User | $user | |
\cheetah\int | $matchday |
A List of Bets that qualify for the given parameters
placeBetWithoutAuthentication(\welwitschi\User $user, \cheetah\Match $match, \cheetah\int $homeScore, \cheetah\int $awayScore) : \cheetah\bool:
Places a bet on behalf of a user without any authentication needed.
Should generally not be used from outside this class.
\welwitschi\User | $user | |
\cheetah\Match | $match | |
\cheetah\int | $homeScore | |
\cheetah\int | $awayScore |
true if the bet was placed successfully, false if not. Bets will fail if the match has already started
placeBetWithLoginSession(\welwitschi\User $user, \cheetah\Match $match, \cheetah\int $homeScore, \cheetah\int $awayScore) : \cheetah\bool:
Places a bet for a logged in User
\welwitschi\User | $user | |
\cheetah\Match | $match | |
\cheetah\int | $homeScore | |
\cheetah\int | $awayScore |
true if the bet was places successfully, else false
placeBetWithApiKey(\welwitschi\User $user, \cheetah\string $apiKey, \cheetah\Match $match, \cheetah\int $homeScore, \cheetah\int $awayScore) : \cheetah\bool:
Places a bet using an API key as authentication
\welwitschi\User | $user | |
\cheetah\string | $apiKey | |
\cheetah\Match | $match | |
\cheetah\int | $homeScore | |
\cheetah\int | $awayScore |
true if the bet placing was successful, false otherwise