Repository class for managing League entities in the database.
More...
#include <league_repository.h>
Repository class for managing League entities in the database.
◆ LeagueRepository()
Construct a new League Repository object.
- Parameters
-
| db_conn | Shared pointer to the database connection. |
◆ insertLeague()
| void LeagueRepository::insertLeague |
( |
const League & |
league | ) |
const |
Insert a new league into the database.
- Parameters
-
| league | The League object to insert. |
◆ insertLeagueWithId()
| void LeagueRepository::insertLeagueWithId |
( |
const League & |
league | ) |
const |
Insert a league with a specific ID into the database.
- Parameters
-
| league | The League object to insert. |
◆ loadAllLeagues()
| std::vector< League > LeagueRepository::loadAllLeagues |
( |
| ) |
const |
Load all leagues from the database.
- Returns
- A vector of League objects.
◆ loadLeaguePoints()
| void LeagueRepository::loadLeaguePoints |
( |
League & |
league | ) |
const |
Load the points of teams for a specific league from the database.
- Parameters
-
| league | The League object to populate with points. |
◆ loadTeamsForLeague()
| void LeagueRepository::loadTeamsForLeague |
( |
League & |
league | ) |
const |
|
private |
◆ resetAllLeaguePoints()
| void LeagueRepository::resetAllLeaguePoints |
( |
| ) |
const |
Reset points for all leagues in the database.
◆ saveLeaguePoints()
| void LeagueRepository::saveLeaguePoints |
( |
const League & |
league | ) |
const |
Save the points of teams in a league to the database.
- Parameters
-
| league | The League object whose points are to be saved. |
◆ saveTeamMemberships()
| void LeagueRepository::saveTeamMemberships |
( |
const League & |
league | ) |
const |
Persists the league membership (Teams.league_id) of its teams.
- Parameters
-
| league | The League whose teams are stored. |
◆ db_conn
The documentation for this class was generated from the following files: